Browse Source

14378 : fixed BusyIndicator focus issue

14297 : fixed ColorPicker null reference error when not databinding to it.
pull/1645/head
brianlagunas_cp 16 years ago
parent
commit
ea2e742da8
  1. 8
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/ColorPicker.cs
  2. 2
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml

8
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/ColorPicker.cs

@ -20,6 +20,7 @@ namespace Microsoft.Windows.Controls
private ColorSpectrumSlider _spectrumSlider; private ColorSpectrumSlider _spectrumSlider;
private Point? _currentColorPosition; private Point? _currentColorPosition;
private Color _currentColor = Colors.White; private Color _currentColor = Colors.White;
private bool _isLoaded;
#endregion //Private Members #endregion //Private Members
@ -257,6 +258,8 @@ namespace Microsoft.Windows.Controls
_okButton = (Button)GetTemplateChild("PART_OkButton"); _okButton = (Button)GetTemplateChild("PART_OkButton");
_okButton.Click += OkButton_Click; _okButton.Click += OkButton_Click;
SetSelectedColor(SelectedColor);
} }
#endregion //Base Class Overrides #endregion //Base Class Overrides
@ -332,7 +335,7 @@ namespace Microsoft.Windows.Controls
SetValue(RProperty, _currentColor.R); SetValue(RProperty, _currentColor.R);
SetValue(GProperty, _currentColor.G); SetValue(GProperty, _currentColor.G);
SetValue(BProperty, _currentColor.B); SetValue(BProperty, _currentColor.B);
UpdateColorShadeSelectorPosition(theColor); UpdateColorShadeSelectorPosition(_currentColor);
} }
private void UpdateColorShadeSelectorPositionAndCalculateColor(Point p, bool calculateColor = true) private void UpdateColorShadeSelectorPositionAndCalculateColor(Point p, bool calculateColor = true)
@ -363,6 +366,9 @@ namespace Microsoft.Windows.Controls
private void UpdateColorShadeSelectorPosition(Color color) private void UpdateColorShadeSelectorPosition(Color color)
{ {
if (_spectrumSlider == null || _colorShadingCanvas == null)
return;
_currentColorPosition = null; _currentColorPosition = null;
HsvColor hsv = ColorUtilities.ConvertRgbToHsv(color.R, color.G, color.B); HsvColor hsv = ColorUtilities.ConvertRgbToHsv(color.R, color.G, color.B);

2
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml

@ -189,7 +189,7 @@
</VisualState> </VisualState>
</VisualStateGroup> </VisualStateGroup>
</VisualStateManager.VisualStateGroups> </VisualStateManager.VisualStateGroups>
<ContentControl x:Name="content" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> <ContentControl x:Name="content" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" IsTabStop="False" Focusable="False"/>
<Rectangle x:Name="overlay" Style="{TemplateBinding OverlayStyle}"/> <Rectangle x:Name="overlay" Style="{TemplateBinding OverlayStyle}"/>
<ContentPresenter x:Name="busycontent"> <ContentPresenter x:Name="busycontent">
<ContentPresenter.Content> <ContentPresenter.Content>

Loading…
Cancel
Save