Ejemplo n.º 1
0
        private void MainLogic()
        {
            // TextBox用のブラシを作成
            //textBoxTextBrush = this.Resources["TextBoxForegroundThemeBrush"] as SolidColorBrush;
            textBoxTextBrush = new SolidColorBrush(Colors.Brown);

            // RgbViewModelオブジェクトを作成し、フィールドに保存
            rgbViewModel = new RgbViewModel();
            rgbViewModel.PropertyChanged += OnRgbViewModelPropertyChanged;
            this.DataContext              = rgbViewModel;

            // ハイライト色に初期化
            rgbViewModel.Color = SystemColors.HighlightColor;
        }
        public MainPage()
        {
            this.InitializeComponent();

            // Get TextBox brush
            textBoxTextBrush = this.Resources["TextBoxForegroundThemeBrush"] as SolidColorBrush;

            // Create RgbViewModel and save as field
            rgbViewModel = new RgbViewModel();
            rgbViewModel.PropertyChanged += OnRgbViewModelPropertyChanged;
            this.DataContext              = rgbViewModel;

            // Initialize to highlight color
            rgbViewModel.Color = new UISettings().UIElementColor(UIElementType.Highlight);
        }