WPF Icon for all app windows

后端 未结 5 1082
天命终不由人
天命终不由人 2020-12-08 03:42

It is possible to set one Icon so, that it would be used on every window in current app. So that i set it once (not on every window by hand)..?

5条回答
  •  忘掉有多难
    2020-12-08 04:20

    You can also try this to set your own icon:

    private void Page_Loaded_1(object sender, RoutedEventArgs e)
            {
                Uri iconUri = new Uri(@"C:\Apps\R&D\WPFNavigation\WPFNavigation\Images\airport.ico", UriKind.RelativeOrAbsolute);
                (this.Parent as Window).Icon = BitmapFrame.Create(iconUri);
            }
    

提交回复
热议问题