public MenuItem()
        {
            isSubmenuOpen = BuildProperty <bool> ("IsSubmenuOpen");

            GetProperty("Header").DependencyPropertyValueChanged += HandleHeaderChanged;

            StyleHelper.ApplyStyle(this, typeof(MenuItem));
        }
        public TextBlock()
        {
            text       = BuildVisualProperty <string> ("Text");
            fontFamily = BuildVisualProperty <string> ("FontFamily");
            fontSize   = BuildVisualProperty <double> ("FontSize");
            foreground = BuildVisualProperty <Color> ("Foreground");

            StyleHelper.ApplyStyle(this, typeof(TextBlock));
        }
예제 #3
0
        public Window()
        {
            if (!Application.IsInitialized)
            {
                throw new ApplicationException("Application must be initialized");
            }

            title = BuildProperty <string> ("Title");
            left  = BuildProperty <double> ("Left");
            top   = BuildProperty <double> ("Top");

            StyleHelper.ApplyStyle(this, typeof(Window));
            Application.Current.RegisterWindow(this);
        }
        public ItemsControl()
        {
            items                    = BuildProperty <ObservableCollection <ItemView> > ("Items");
            items.Value              = new ObservableCollection <ItemView> ();
            Items.CollectionChanged += HandleItemsChanged;

            itemsPanel = BuildProperty <Panel> ("ItemsPanel");
            itemsPanel.DependencyPropertyValueChanged += HandleItemsPanelChanged;
            ItemsPanel = new StackPanel();

            itemsSource = BuildProperty <IEnumerable> ("ItemsSource");
            itemsSource.DependencyPropertyValueChanged += ItemsSourceChanged;

            ItemTemplate = new DataTemplate(o => o is UIElement ? o as UIElement : new TextBlock()
            {
                Text = o.ToString()
            });

            StyleHelper.ApplyStyle(this, typeof(ItemsControl));
        }
 public TabControl()
 {
     StyleHelper.ApplyStyle(this, typeof(TabControl));
 }
 public UserControl()
 {
     StyleHelper.ApplyStyle(this, typeof(UserControl));
 }
예제 #7
0
 public Button()
 {
     StyleHelper.ApplyStyle(this, typeof(Button));
 }
예제 #8
0
 public Menu()
 {
     StyleHelper.ApplyStyle(this, typeof(Menu));
 }