public void ApplyFilter(Object passedObj, Object dontCare = null) { double value = Convert.ToDouble(passedObj); if (value == 0) { Image image = (m_FilterButton.Content as StackPanel).Children[0] as Image; image.Source = new BitmapImage(new Uri(@"/L3Filter-DensityAlarm;component/DensityAlarmOff.png", UriKind.Relative)); if (dockPanel.Effect != null) { dockPanel.Effect = null; m_EffectChanged = true; } } else { Image image = (m_FilterButton.Content as StackPanel).Children[0] as Image; image.Source = new BitmapImage(new Uri(@"/L3Filter-DensityAlarm;component/DensityAlarmOn.png", UriKind.Relative)); DensityAlarmEffect densityEffect = new DensityAlarmEffect(); densityEffect.SampleI = value; if (dockPanel.Effect == null || (dockPanel.Effect as DensityAlarmEffect).SampleI != value) { dockPanel.Effect = densityEffect; m_EffectChanged = true; } } //var currSliderVal = m_ValueSlider.Value / 100.0; //if (currSliderVal != value && m_ValueSlider.IsEnabled) //{ // m_ValueSlider.IsEnabled = false; // m_ValueSlider.Value = value * 100.0; // m_ValTextBox.Text = (m_ValueSlider.Value).ToString("F0") + " %"; // m_ValueSlider.IsEnabled = true; //} }
public void ApplyFilter (Object passedObj, Object dontCare = null) { double value = Convert.ToDouble(passedObj); if (value == 0) { Image image = (m_FilterButton.Content as StackPanel).Children[0] as Image; image.Source = new BitmapImage(new Uri(@"/L3Filter-DensityAlarm;component/DensityAlarmOff.png", UriKind.Relative)); if (dockPanel.Effect != null) { dockPanel.Effect = null; m_EffectChanged = true; } } else { Image image = (m_FilterButton.Content as StackPanel).Children[0] as Image; image.Source = new BitmapImage(new Uri(@"/L3Filter-DensityAlarm;component/DensityAlarmOn.png", UriKind.Relative)); DensityAlarmEffect densityEffect = new DensityAlarmEffect(); densityEffect.SampleI = value; if (dockPanel.Effect == null || (dockPanel.Effect as DensityAlarmEffect).SampleI != value) { dockPanel.Effect = densityEffect; m_EffectChanged = true; } } //var currSliderVal = m_ValueSlider.Value / 100.0; //if (currSliderVal != value && m_ValueSlider.IsEnabled) //{ // m_ValueSlider.IsEnabled = false; // m_ValueSlider.Value = value * 100.0; // m_ValTextBox.Text = (m_ValueSlider.Value).ToString("F0") + " %"; // m_ValueSlider.IsEnabled = true; //} }