コード例 #1
0
 public TextContainerEditor(StackPanel stackPanel, bool isFieldRequired)
 {
     this.stackPanel      = stackPanel;
     this.label           = stackPanel.Children[0] as TextBlock;
     state                = TextContainerState.NotSelected;
     this.isFieldRequired = isFieldRequired;
 }
コード例 #2
0
        /* protected Style selectedTextBoxStyle, selectedPasswordBoxStyle, notSelectedInputFieldStyle;
         * SolidColorBrush strongPassword = new SolidColorBrush(Color.FromRgb(44, 180, 54));
         * SolidColorBrush weakPassword = new SolidColorBrush(Color.FromRgb(255, 95, 95));
         * SolidColorBrush mediumPassword = new SolidColorBrush(Color.FromRgb(255, 195, 0));
         * SolidColorBrush goodPassword = new SolidColorBrush(Color.FromRgb(147, 218, 24));
         * SolidColorBrush notSelectedPasswordBoxColor = (SolidColorBrush)Application.Current.FindResource("AppResBlueColor");
         * SolidColorBrush selectedPasswordBoxColor = (SolidColorBrush)Application.Current.FindResource("AppResBlackColor"); */
        public TextContainerTemplate()
        {
            state = TextContainerState.NotSelected;

            errorTextContainerStyle       = (Style)Application.Current.Resources["errorTextContainer"];
            notSelectedTextContainerStyle = (Style)Application.Current.Resources["notSelectedTextContainer"];

            labelTextBinding = new Binding
            {
                Source = this,
                Path   = new PropertyPath("InputFieldName")
            };

            messageLabelBinding = new Binding
            {
                Source = this,
                Path   = new PropertyPath("ErrorMessage")
            };
        }