public void SymbolIconSourceTest() { SymbolIconSource iconSource = null; RunOnUIThread.Execute(() => { iconSource = new SymbolIconSource(); // IconSource.Foreground should be null to allow foreground inheritance from // the parent to work. Verify.AreEqual(iconSource.Foreground, null); Log.Comment("Validate the defaults match SymbolIcon."); var icon = new SymbolIcon(); Verify.AreEqual(icon.Symbol, iconSource.Symbol); Log.Comment("Validate that you can change the properties."); iconSource.Foreground = new SolidColorBrush(Windows.UI.Colors.Red); iconSource.Symbol = Symbol.HangUp; }); IdleSynchronizer.Wait(); RunOnUIThread.Execute(() => { Verify.IsTrue(iconSource.Foreground is SolidColorBrush); Verify.AreEqual(Windows.UI.Colors.Red, (iconSource.Foreground as SolidColorBrush).Color); Verify.AreEqual(Symbol.HangUp, iconSource.Symbol); }); }
public void OnSetIconButtonClicked(object sender, RoutedEventArgs args) { if (this.IconComboBox.SelectedItem == IconPeople) { SymbolIconSource symbolIconSource = new SymbolIconSource(); symbolIconSource.Symbol = Symbol.People; getTeachingTip().IconSource = symbolIconSource; } else { getTeachingTip().IconSource = null; } }
private void SetIconCheckBox_CheckedChanged(object sender, RoutedEventArgs e) { if (_titleBar != null) { if (SetIconCheckBox.IsChecked.Value) { var icon = new Microsoft.UI.Xaml.Controls.SymbolIconSource(); icon.Symbol = Symbol.Mail; _titleBar.IconSource = icon; } else { _titleBar.IconSource = null; } } }
public TitleBarPage() { this.InitializeComponent(); _titleBar = new TitleBar(); _titleBar.Title = "Experimental Controls Test App"; var icon = new Microsoft.UI.Xaml.Controls.SymbolIconSource(); icon.Symbol = Symbol.Keyboard; _titleBar.IconSource = icon; var testFrame = Window.Current.Content as TestFrame; testFrame.CustomElement = _titleBar; // Set window min size to the smallest width we support. ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(320, 500)); }
public TabViewPage() { this.InitializeComponent(); _iconSource = new SymbolIconSource(); _iconSource.Symbol = Symbol.Placeholder; ObservableCollection <TabDataItem> itemSource = new ObservableCollection <TabDataItem>(); for (int i = 0; i < 5; i++) { var item = new TabDataItem(); item.IconSource = _iconSource; item.Header = "Item " + i; item.Content = "This is tab " + i + "."; itemSource.Add(item); } DataBindingTabView.TabItemsSource = itemSource; }
public void TeachingTipWithContentAndWithoutHeroContentDoesNotCrash() { var loadedEvent = new AutoResetEvent(false); RunOnUIThread.Execute(() => { Grid contentGrid = new Grid(); SymbolIconSource iconSource = new SymbolIconSource(); iconSource.Symbol = Symbol.People; TeachingTip teachingTip = new TeachingTip(); teachingTip.Content = contentGrid; teachingTip.IconSource = (IconSource)iconSource; teachingTip.Loaded += (object sender, RoutedEventArgs args) => { loadedEvent.Set(); }; Content = teachingTip; }); IdleSynchronizer.Wait(); loadedEvent.WaitOne(); }
public TabViewPage() { this.InitializeComponent(); _iconSource = new SymbolIconSource(); _iconSource.Symbol = Symbol.Placeholder; ObservableCollection <TabDataItem> itemSource = new ObservableCollection <TabDataItem>(); for (int i = 0; i < 5; i++) { var item = new TabDataItem(); item.IconSource = _iconSource; item.Header = "Item " + i; item.Content = "This is tab " + i + "."; itemSource.Add(item); } DataBindingTabView.TabItemsSource = itemSource; backgroundColorCache = BackgroundGrid.Background; activeTabContentBackgroundBrushCache = FirstTabContent.Background; CacheFirstTabSelectedBackgroundPathFill(); }