示例#1
0
        private static void IsMinimizedChanged(OdcExpander expander, AvaloniaPropertyChangedEventArgs e)
        {
            bool minimized = (bool)e.NewValue;

            expander.IsEnabled = !minimized;
            RoutedEventArgs args = new RoutedEventArgs(minimized ? MinimizedEvent : MaximizedEvent);

            expander.RaiseEvent(args);
        }
示例#2
0
        private static void HeaderClassesChanged(OdcExpander o, AvaloniaPropertyChangedEventArgs e)
        {
            if (e.NewValue is Classes && o._header != null)
            {
                Classes classes = e.NewValue as Classes;

                foreach (var item in classes)
                {
                    if (o._header.Classes.Contains(item) == false)
                    {
                        o._header.Classes.Add(item);
                    }
                }
            }
        }
示例#3
0
        private static void IsExpandedChanged(OdcExpander expander, AvaloniaPropertyChangedEventArgs e)
        {
            RoutedEventArgs args = new RoutedEventArgs((bool)e.NewValue ? ExpandedEvent : CollapsedEvent);

            expander.RaiseEvent(args);
        }
示例#4
0
 private static void PressedHeaderBackgroundPropertyChangedCallback(OdcExpander expander, AvaloniaPropertyChangedEventArgs e)
 {
     expander.HasPressedBackground = e.NewValue != null;
 }