public static Visibility ControlStateToVisibility(ControlStateType state)
        {
            if (state == ControlStateType.Collapsed)
            {
                return(Visibility.Collapsed);
            }

            return(Visibility.Visible);
        }
        protected virtual void OnEnter(object sender,
                                       RoutedEventArgs e)
        {
            State = ControlStateType.Loaded;

            if (!IsOnEnterActive)
            {
                e.Handled = true;
                return;
            }
        }
        protected WidgetContent()
        {
            Initialized        += OnCreated;
            Initialized        += OnInitialized;
            Loaded             += OnFirstEnter;
            Loaded             += OnEnter;
            Unloaded           += OnFirstExit;
            Unloaded           += OnExit;
            DataContextChanged += OnDataContextChanged;

            IsCreated       = false;
            IsFirstEntered  = false;
            IsFirstExited   = false;
            IsOnEnterActive = true;
            IsOnExitActive  = true;
            State           = ControlStateType.Unknown;
        }
 public static bool ControlStateToEnabled(ControlStateType state)
 {
     return(state == ControlStateType.Enabled);
 }