Device.RuntimePlatform
con la Device.GTK
costante (che corrisponde alla stringa 'GTK').In code, compare the value of Device.RuntimePlatform
with the Device.GTK
constant (which equals the string 'GTK').Se esiste una corrispondenza, l'applicazione è in esecuzione in GTK #.If there's a match, the application is running on GTK#.OnPlatform
tag per selezionare un valore della proprietà specifico per la piattaforma:In XAML, you can use the OnPlatform
tag to select a property value specific to the platform:ContentPage
pagine derivate da per i progetti nativi, inclusi i progetti GTK #.Native Forms allows Xamarin.Forms ContentPage
-derived pages to be consumed by native projects, including GTK# projects.Questa operazione può essere eseguita creando un'istanza della ContentPage
pagina derivata da e trasformandola nel tipo GTK # nativo usando il CreateContainer
metodo di estensione:This can be accomplished by creating an instance of the ContentPage
-derived page and converting it to the native GTK# type using the CreateContainer
extension method: