private void Radio_Click(object sender, RoutedEventArgs e) { RibbonRadioButton keuze = (RibbonRadioButton)sender; SolidColorBrush kleur = (SolidColorBrush) new BrushConverter().ConvertFromString(keuze.Tag.ToString()); TextBoxVoorbeeld.Foreground = kleur; }
public RibbonGifControl(String path, RibbonRadioButton im) { if (null == im) { throw new Exception("Error: null Image"); } m_bitmapSources = new List <BitmapSource>(); m_ribbonButton = im; m_imageStreamSource = new FileStream(@path, FileMode.Open, FileAccess.Read, FileShare.Read); m_decoder = new GifBitmapDecoder(m_imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); for (int i = 0; i < m_decoder.Frames.Count; i++) { m_bitmapSources.Add(m_decoder.Frames[i]); } if (m_decoder.Frames.Count < 1) { throw new Exception("Error gif with no frames: " + path); } m_index = m_decoder.Frames.Count - 1; m_ribbonButton.SmallImageSource = m_bitmapSources[m_index]; //image.Width = bitmapSources[index].Width; //image.Height = bitmapSources[index].Height; m_dispatcherTimer = new DispatcherTimer(); m_dispatcherTimer.Interval = TimeSpan.FromMilliseconds(300); m_dispatcherTimer.Tick += delegate { flip(); }; }
private void ButtonManage(RibbonRadioButton rrb) { string parent = (rrb.Parent as RibbonGroup).Header.ToString(); if (parent == "笔尖颜色") { color = rrb.Label.ToString(); } rrb.IsChecked = true; ChangeSelect(rrb.Label.ToString()); }
private static object OnCoerceFocusable(DependencyObject d, object baseValue) { RibbonRadioButton button = (RibbonRadioButton)d; if (button.CoerceFocusable) { return(false); } return(baseValue); }
public void RibbonRadioButton_Checked(object sender, RoutedEventArgs e) { RibbonRadioButton rrb = e.Source as RibbonRadioButton; string parent = (rrb.Parent as RibbonGroup).Header.ToString(); if (parent == "笔尖颜色") { color = rrb.Label.ToString(); } Assist.rrb = rrb; ButtonManage(rrb); client.sendButtonInfo(rrb.Label.ToString()); }
private void RibbonRadioButton_Checked(object sender, RoutedEventArgs e) { RibbonRadioButton rrb = e.Source as RibbonRadioButton; string parent = (rrb.Parent as RibbonGroup).Header.ToString(); if (selectedTabHeader == "例1") { p1.SelectedName = rrb.Label; if (parent == "钢笔颜色") { rrbPen.IsChecked = true; p1.SelectedName = rrbPen.Label; } if (parent == "笔画类型") { rrbInk.IsChecked = true; } } else { p2.ChangeSelect(rrb.Label); if (parent == "墨迹类型") { switch (selectedTabHeader) { case "例2": rt2.rrbEllipseStylus.IsChecked = true; break; case "例3": rt3.rrbEllipseStylus.IsChecked = true; break; case "例4": rt4.rrbEllipseStylus.IsChecked = true; break; case "例5": rt5.rrbEllipseStylus.IsChecked = true; break; case "例6": rt6.rrbEllipseStylus.IsChecked = true; break; case "例7": rt7.rrbEllipseStylus.IsChecked = true; break; } } } }
private void RibbonRadioButton_Checked(object sender, RoutedEventArgs e) { RibbonRadioButton rrb = e.Source as RibbonRadioButton; string parent = (rrb.Parent as RibbonGroup).Header.ToString(); p.ChangeSelect(rrb.Label); if (parent == "墨迹类型") { switch (header) { case "例2": rt2.rrbEllipseStylus.IsChecked = true; break; case "例3": rt3.rrbEllipseStylus.IsChecked = true; break; case "例4": rt4.rrbEllipseStylus.IsChecked = true; break; case "例5": rt5.rrbEllipseStylus.IsChecked = true; break; case "例6": rt6.rrbEllipseStylus.IsChecked = true; break; case "例7": rt7.rrbEllipseStylus.IsChecked = true; break; } } }
/// <summary> /// Initialize Automation Peer for RibbonRadioButton /// </summary> public RibbonRadioButtonAutomationPeer(RibbonRadioButton owner) : base(owner) { }
public static void InitializeHooksRibbonRadioButton(RibbonRadioButton button) { if (null == lchecked) { lchecked = new LinearGradientBrush(); lchecked.EndPoint = new Point(0, 1); lchecked.StartPoint = new Point(0, 0); lchecked.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFFFDCA0"), 0)); lchecked.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFFFD692"), 0.181f)); lchecked.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFFFC45D"), 0.39f)); lchecked.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFFFD178"), 1)); lmouseover = new LinearGradientBrush(); lmouseover.EndPoint = new Point(0, 1); lmouseover.StartPoint = new Point(0, 0); lmouseover.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFFEFBF4"), 0)); lmouseover.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFFDE7CE"), 0.181f)); lmouseover.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFFDDEB8"), 0.39f)); lmouseover.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFFFCE6B"), 0.39f)); lmouseover.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFFFDE9A"), 0.79)); lmouseover.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFFFEBAA"), 1)); } button.MouseEnter += delegate { if (true == button.IsChecked) { button.CheckedBackground = lmouseover; } else { button.CheckedBackground = lchecked; } }; button.MouseLeave += delegate { button.CheckedBackground = lchecked; }; button.MouseMove += delegate { if (true == button.IsChecked) { button.CheckedBackground = lmouseover; } else { button.CheckedBackground = lchecked; } }; button.Click += delegate { if (true == button.IsChecked) { button.CheckedBackground = lmouseover; } else { button.CheckedBackground = lchecked; } }; }