Update the UWP sample titlebar/statusbar

This commit is contained in:
Matthew Leibowitz 2016-06-22 12:24:59 +02:00
Родитель e00499b2e3
Коммит 3cd39d5e6b
3 изменённых файлов: 30 добавлений и 0 удалений

Просмотреть файл

@ -2,6 +2,7 @@
using System.IO;
using Windows.ApplicationModel;
using Windows.Storage;
using Windows.UI;
namespace Skia.Forms.Demo.UWP
{
@ -9,6 +10,25 @@ namespace Skia.Forms.Demo.UWP
{
public MainPage ()
{
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent(typeof(Windows.UI.ViewManagement.StatusBar).FullName))
{
var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
statusBar.BackgroundColor = Color.FromArgb(0xff, 0x34, 0x98, 0xdb);
statusBar.ForegroundColor = Colors.White;
statusBar.BackgroundOpacity = 1;
}
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent(typeof(Windows.UI.ViewManagement.ApplicationViewTitleBar).FullName))
{
var titlebar = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TitleBar;
titlebar.BackgroundColor = Color.FromArgb(0xff, 0x34, 0x98, 0xdb);
titlebar.ForegroundColor = Colors.White;
titlebar.ButtonBackgroundColor = Color.FromArgb(0xff, 0x34, 0x98, 0xdb);
titlebar.ButtonForegroundColor = Colors.White;
titlebar.ButtonHoverBackgroundColor = Color.FromArgb(0xff, 0x2c, 0x3e, 0x50);
titlebar.ButtonHoverForegroundColor = Colors.White;
}
// set up resource paths
string fontName = "content-font.ttf";
SkiaSharp.Demos.CustomFontPath = Path.Combine (Package.Current.InstalledLocation.Path, "Assets", fontName);

Просмотреть файл

@ -139,6 +139,11 @@
<Name>Skia.Forms.Demo</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<SDKReference Include="WindowsMobile, Version=10.0.10240.0">
<Name>Windows Mobile Extensions for the UWP</Name>
</SDKReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>

Просмотреть файл

@ -146,6 +146,11 @@
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<SDKReference Include="WindowsMobile, Version=10.0.10586.0">
<Name>Windows Mobile Extensions for the UWP</Name>
</SDKReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>