Mini Kabibi Habibi

Current Path : C:/Users/Public/Documents/DXperience 13.1 Demos/WPF/CS/BarsDemo.Wpf/Modules/
Upload File :
Current File : C:/Users/Public/Documents/DXperience 13.1 Demos/WPF/CS/BarsDemo.Wpf/Modules/BarProperties.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using DevExpress.Xpf.Bars;
using DevExpress.Xpf.Core;
using DevExpress.Xpf.Utils;

namespace BarsDemo {
    public class InverseBoolConverter : IValueConverter {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            return !((bool)value);
        }
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            throw new NotImplementedException();
        }
    }
    public partial class BarProperties : BarsDemoModule {
        public static readonly DependencyProperty BarProperty =
            DependencyPropertyManager.Register("Bar", typeof(Bar), typeof(BarProperties), new FrameworkPropertyMetadata());
        public Bar Bar {
            get { return (Bar)GetValue(BarProperty); }
            set { SetValue(BarProperty, value); }
        }

        public BarProperties() {
            InitializeComponent();
            Bar = bar1;
        }

        protected virtual void isVisibleCheck_EditValueChanged(object sender, RoutedEventArgs e) {
            this.props.IsEnabled = (bool)this.isVisibleCheck.IsChecked;
        }
        protected virtual void isEnabledCheck_EditValueChanged(object sender, RoutedEventArgs e) {
            this.props.IsEnabled = (bool)this.isEnabledCheck.IsChecked;
        }
        protected virtual void barTypeBar_Checked(object sender, EventArgs e) {
            if(Bar == null)
                return;
            Bar.IsMainMenu = Bar.IsStatusBar = false;
            this.showDragWidgetCheck.IsEnabled = true;
            this.showCustomizationButtonCheck.IsEnabled = true;
            this.containerName.SelectedIndex = 0;
            allowCollapseCheck_UpdateEnabled();
        }
        protected virtual void barTypeMainMenu_Checked(object sender, EventArgs e) {
            if(Bar == null)
                return;
            Bar.IsMainMenu = true;
            this.showDragWidgetCheck.IsEnabled = false;
            this.showCustomizationButtonCheck.IsEnabled = true;
            this.containerName.SelectedIndex = 0;
            allowCollapseCheck_UpdateEnabled();
        }
        protected virtual void barTypeStatusBar_Checked(object sender, EventArgs e) {
            if(Bar == null)
                return;
            Bar.IsStatusBar = true;
            this.showDragWidgetCheck.IsEnabled = false;
            this.showCustomizationButtonCheck.IsEnabled = false;
            this.containerName.SelectedIndex = 1;
            allowCollapseCheck_UpdateEnabled();
        }
        protected virtual void useWholeRowCheck_EditValueChanged(object sender, EventArgs e) {
            allowCollapseCheck_UpdateEnabled();
        }
        protected virtual void allowCollapseCheck_UpdateEnabled() {
            if(Bar == null) return;
            allowCollapseCheck.IsEnabled = !Bar.IsUseWholeRow;
        }
    }
}