I love WPF

"jamais sans son interface"

I love WPF

"jamais sans son interface"

Month: avril 2017

Override System.Windows.Interactivity.EventTrigger

for capturing message for example public class EventTrigger : System.Windows.Interactivity.EventTrigger { #region CaptureEvent (DP SHORT) public bool CaptureEvent { get { return (bool)GetValue(CaptureEventProperty); } set { SetValue(CaptureEventProperty, value); } } public static readonly DependencyProperty CaptureEventProperty = DependencyProperty.Register(« CaptureEvent », typeof(bool), typeof(EventTrigger), new PropertyMetadata(false)); #endregion protected override void OnEvent(EventArgs eventArgs) { if (eventArgs is RoutedEventArgs) { (eventArgs as […]

SolidColorBrush from another SolidColorBrush

if you have initial SolidColorBrush like <SolidColorBrush x:Key= »ycolor » Color= »green » /> you can get the color or create another SolidColorBrush and using color <SolidColorBrush x:Key= »ycolor_copy » Color= »{Binding Source={StaticResource ycolor}, Path=Color} » />  

Override custom color

for overriding custom color like <SolidColorBrush x:Key= »xcolor » Color= »#6D9DFF » /> redefine the same SolidColorBrush with the same Key <!– using resource –> <Border BorderBrush= »Black » BorderThickness= »1″ HorizontalAlignment= »Left » Height= »43″ Background= »{StaticResource xcolor} » Margin= »366,177,0,0″ VerticalAlignment= »Top » Width= »116″ /> <!– redefine resource –> <Grid Margin= »366,225,0,0″ HorizontalAlignment= »Left » Width= »116″ Height= »43″ VerticalAlignment= »Top »> <Grid.Resources> <SolidColorBrush x:Key= »xcolor » Color= »red » /> </Grid.Resources> <Border BorderBrush= »Black » BorderThickness= »1″ Background= »{StaticResource xcolor} » /> </Grid> […]

Retour en haut