public FlyoutControl(Flyout self, FlyoutType type, object data = null)
        {
            this.InitializeComponent();
            flyoutSelf = self;

            // Transition
            Content.Transitions = new TransitionCollection();
            Content.Transitions.Add(new EntranceThemeTransition()
            {
                FromHorizontalOffset = (SettingsPane.Edge == SettingsEdgeLocation.Right) ? ContentAnimationOffset : (ContentAnimationOffset * -1)
            });

            // Title
            FlyoutTitle.Text = Helper.Translate("FlyoutType" + type.ToString());
            
            // Type switch
            switch(type)
            {
                case FlyoutType.About:              { FlyoutContent.Child = new About(self); break; }
                case FlyoutType.AccountEdit:        { FlyoutContent.Child = new AccountEdit(self, data); break; }
                case FlyoutType.AccountListEdit:    { FlyoutContent.Child = new AccountListEdit(self); break; } 
                case FlyoutType.AddContact:         { FlyoutContent.Child = new AddContact(self); break; }
                case FlyoutType.EditContact:        { FlyoutContent.Child = new EditContact(self, (Backend.Data.Contact)data); break; }
                case FlyoutType.Notifications:      { FlyoutContent.Child = new Notifications(self); break; }
                case FlyoutType.Subscription:       { FlyoutContent.Child = new Subscription(self, (Backend.Data.Contact)data); break; }
                case FlyoutType.RemoveContact:      { FlyoutContent.Child = new RemoveContact(self, (Backend.Data.Contact)data); break; }
                case FlyoutType.SettingsEdit:       { FlyoutContent.Child = new SettingsEdit(self); break; }
                case FlyoutType.StatusEdit:         { FlyoutContent.Child = new StatusEdit(self); break; }
                case FlyoutType.ThemeEdit:          { FlyoutContent.Child = new ThemeEdit(self); break; }
            }
        }
Exemple #2
0
        // --------------------------------------------------

        private int GetFlyoutWidth(FlyoutType type)
        {
            switch (type)
            {
            case FlyoutType.About: { return(SmallFlyoutSize); }

            case FlyoutType.AccountEdit: { return(SmallFlyoutSize); }

            case FlyoutType.AccountListEdit: { return(SmallFlyoutSize); }

            case FlyoutType.AddContact: { return(SmallFlyoutSize); }

            case FlyoutType.EditContact: { return(SmallFlyoutSize); }

            case FlyoutType.Notifications: { return(BigFlyoutSize); }

            case FlyoutType.Subscription: { return(SmallFlyoutSize); }

            case FlyoutType.RemoveContact: { return(SmallFlyoutSize); }

            case FlyoutType.SettingsEdit: { return(SmallFlyoutSize); }

            case FlyoutType.StatusEdit: { return(SmallFlyoutSize); }

            case FlyoutType.ThemeEdit: { return(BigFlyoutSize); }
            }

            return(SmallFlyoutSize);
        }
Exemple #3
0
        public Flyout(FlyoutType type, object data = null, Flyout parent = null, bool settingsPaneParent = false)
        {
            Parent             = parent;
            SettingsPaneParent = settingsPaneParent;

            // Get bounds
            Rect   WindowBounds  = Window.Current.Bounds;
            double settingsWidth = GetFlyoutWidth(type);

            internalPopup         = new Popup();
            internalPopup.Opened += OnPopupOpened;
            internalPopup.Closed += OnPopupClosed;


            // Popup settings
            internalPopup.IsLightDismissEnabled = true;
            internalPopup.Width  = settingsWidth;
            internalPopup.Height = WindowBounds.Height;

            // Animations
            internalPopup.ChildTransitions = new TransitionCollection();
            internalPopup.ChildTransitions.Add(new PaneThemeTransition()
            {
                Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ? EdgeTransitionLocation.Right : EdgeTransitionLocation.Left
            });

            // FlyoutControl
            FlyoutControl ctlFlyout = new FlyoutControl(this, type, data);

            ctlFlyout.Width     = settingsWidth;
            ctlFlyout.Height    = WindowBounds.Height;
            internalPopup.Child = ctlFlyout;

            // Popup position
            internalPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (WindowBounds.Width - settingsWidth) : 0);
            internalPopup.SetValue(Canvas.TopProperty, 0);

            Show();

            if (Parent != null)
            {
                Parent.Hide();
            }
        }
Exemple #4
0
        public Flyout(FlyoutType type, object data = null, Flyout parent = null, bool settingsPaneParent = false)
        {
            Parent = parent;
            SettingsPaneParent = settingsPaneParent;

            // Get bounds
            Rect WindowBounds = Window.Current.Bounds;
            double settingsWidth = GetFlyoutWidth(type);

            internalPopup = new Popup();
            internalPopup.Opened += OnPopupOpened;
            internalPopup.Closed += OnPopupClosed;


            // Popup settings
            internalPopup.IsLightDismissEnabled = true;
            internalPopup.Width = settingsWidth;
            internalPopup.Height = WindowBounds.Height;

            // Animations
            internalPopup.ChildTransitions = new TransitionCollection();
            internalPopup.ChildTransitions.Add(new PaneThemeTransition()
            {
                Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ? EdgeTransitionLocation.Right : EdgeTransitionLocation.Left
            });

            // FlyoutControl
            FlyoutControl ctlFlyout = new FlyoutControl(this, type, data);
            ctlFlyout.Width = settingsWidth;
            ctlFlyout.Height = WindowBounds.Height;
            internalPopup.Child = ctlFlyout;

            // Popup position
            internalPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (WindowBounds.Width - settingsWidth) : 0);
            internalPopup.SetValue(Canvas.TopProperty, 0);

            Show();

            if (Parent != null)
                Parent.Hide();
        }
Exemple #5
0
        public FlyoutControl(Flyout self, FlyoutType type, object data = null)
        {
            this.InitializeComponent();
            flyoutSelf = self;

            // Transition
            Content.Transitions = new TransitionCollection();
            Content.Transitions.Add(new EntranceThemeTransition()
            {
                FromHorizontalOffset = (SettingsPane.Edge == SettingsEdgeLocation.Right) ? ContentAnimationOffset : (ContentAnimationOffset * -1)
            });

            // Title
            FlyoutTitle.Text = Helper.Translate("FlyoutType" + type.ToString());

            // Type switch
            switch (type)
            {
            case FlyoutType.About:              { FlyoutContent.Child = new About(self); break; }

            case FlyoutType.AccountEdit:        { FlyoutContent.Child = new AccountEdit(self, data); break; }

            case FlyoutType.AccountListEdit:    { FlyoutContent.Child = new AccountListEdit(self); break; }

            case FlyoutType.AddContact:         { FlyoutContent.Child = new AddContact(self); break; }

            case FlyoutType.EditContact:        { FlyoutContent.Child = new EditContact(self, (Backend.Data.Contact)data); break; }

            case FlyoutType.Notifications:      { FlyoutContent.Child = new Notifications(self); break; }

            case FlyoutType.Subscription:       { FlyoutContent.Child = new Subscription(self, (Backend.Data.Contact)data); break; }

            case FlyoutType.RemoveContact:      { FlyoutContent.Child = new RemoveContact(self, (Backend.Data.Contact)data); break; }

            case FlyoutType.SettingsEdit:       { FlyoutContent.Child = new SettingsEdit(self); break; }

            case FlyoutType.StatusEdit:         { FlyoutContent.Child = new StatusEdit(self); break; }

            case FlyoutType.ThemeEdit:          { FlyoutContent.Child = new ThemeEdit(self); break; }
            }
        }
Exemple #6
0
        // --------------------------------------------------

        private int GetFlyoutWidth(FlyoutType type)
        {
            switch (type)
            {
                case FlyoutType.About: { return SmallFlyoutSize; }
                case FlyoutType.AccountEdit: { return SmallFlyoutSize; }
                case FlyoutType.AccountListEdit: { return SmallFlyoutSize; }
                case FlyoutType.AddContact: { return SmallFlyoutSize; }
                case FlyoutType.EditContact: { return SmallFlyoutSize; }
                case FlyoutType.Notifications: { return BigFlyoutSize; }
                case FlyoutType.Subscription: { return SmallFlyoutSize; }
                case FlyoutType.RemoveContact: { return SmallFlyoutSize; }
                case FlyoutType.SettingsEdit: { return SmallFlyoutSize; }
                case FlyoutType.StatusEdit: { return SmallFlyoutSize; }
                case FlyoutType.ThemeEdit: { return BigFlyoutSize; }
            }

            return SmallFlyoutSize;
        }