Domanda

Voglio impostare il menu Sfondo flyout con C # perché sto creando flyout a runtime come posso farlo Lo so con xaml come questo

<Flyout.FlyoutPresenterStyle>
            <Style TargetType="FlyoutPresenter">
                <Setter Property="ScrollViewer.ZoomMode" Value="Enabled"/>
                <Setter Property="Background" Value="Black"/>
                <Setter Property="BorderBrush" Value="Gray"/>
                <Setter Property="BorderThickness" Value="5"/>
                <Setter Property="MinHeight" Value="300"/>
                <Setter Property="MinWidth" Value="300"/>
            </Style>
        </Flyout.FlyoutPresenterStyle>
.

Come raggiungere questo utilizzo c #?

È stato utile?

Soluzione

Alla fine risolto IT

  MenuFlyout m = new MenuFlyout();
  Style s = new Windows.UI.Xaml.Style { TargetType = typeof(MenuFlyoutPresenter) };
  s.Setters.Add(new Setter(BackgroundProperty,new SolidColorBrush(Colors.Blue)));
  MenuFlyoutItem mn = new MenuFlyoutItem();
  m.MenuFlyoutPresenterStyle = s;
  m.Items.Add(mn);
.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top