0

こんにちは、アプリケーションバーにこの問題があります。テーマをライトに変更すると、アイコンが黒くなります。これを防ぐか、ライト テーマがオンのときに背景色を別のものに変更できますか。

今、私は常に紫色の背景を持っているので、アイコンまたは背景を変更してください。

これについてのアイデアはありますか?

4

1 に答える 1

1

暗いまたは明るいテーマの色を検出するには、使用できます

bool DarkThemeUsed ()
{ 
     return Visibility.Visible ==   (Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"];
}

bool LightThemeUsed() 
{
     return Visibility.Visible == (Visibility)Application.Current.Resources["PhoneLightThemeVisibility"];
}

ソースはdeveloper.nokia.comです: この Web サイトには、Windows Phone の小さな問題に対する多くのアイデアと解決策があります:D

アプリケーションを起動したとき (App.xaml.cs で)、携帯電話が暗いか明るいかをテストできます。

private void Application_Launching(object sender, LaunchingEventArgs e)
{
    DetectUserTheme();
}

private void DetectUserTheme()
{
    if(LightThemeUsed())
    {
        // Adapt your icons, background for the light theme.
        return;
    }

    // Adapt your icons, background for the dark theme. 
}

ユーザーが定義する色のアクセントを使用することもできます。

 Color currentAccentColorHex = 
        (Color)Application.Current.Resources["PhoneAccentColor"];

また、アプリケーションでいくつかの色のテキストや要素に使用できます...

于 2013-06-07T08:24:40.887 に答える