Share via


FlyoutPage-Navigationsleiste unter Windows

Diese Universelle Windows-Plattform plattformspezifischen Wird verwendet, um die Navigationsleiste in einem FlyoutPage, und wird in XAML verwendet, indem die FlyoutPage.CollapseStyle und FlyoutPage.CollapsedPaneWidth angefügten Eigenschaften festgelegt werden:

<FlyoutPage ...
                  xmlns:windows="clr-namespace:Xamarin.Forms.PlatformConfiguration.WindowsSpecific;assembly=Xamarin.Forms.Core"
                  windows:FlyoutPage.CollapseStyle="Partial"
                  windows:FlyoutPage.CollapsedPaneWidth="48">
  ...
</FlyoutPage>

Alternativ kann es auch von C# aus über die Fluent-API genutzt werden:

using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;
...

page.On<Windows>().SetCollapseStyle(CollapseStyle.Partial).CollapsedPaneWidth(148);

Die Methode FlyoutPage.On<Windows> legt fest, dass dies plattformspezifisch ist und nur unter Windows ausgeführt wird. Die Page.SetCollapseStyle Methode im Xamarin.Forms.PlatformConfiguration.WindowsSpecific Namespace wird verwendet, um die Collapse-Formatvorlage anzugeben, wobei die CollapseStyle Aufzählung zwei Werte bereitstellt: Full und Partial. Die FlyoutPage.CollapsedPaneWidth Methode wird verwendet, um die Breite einer teilweise reduzierten Navigationsleiste anzugeben.

Das Ergebnis ist, dass eine angegebene CollapseStyle Instanz angewendet FlyoutPage wird, wobei auch die Breite angegeben wird:

Plattformspezifisch für reduzierte Navigationsleiste