public Subscription(Flyout self, Backend.Data.Contact contact)
 {
     this.InitializeComponent();
     this.flyoutSelf = self;
     this.DataContext = contact;
     this.CurrentContact = contact;
 }
        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; }
            }
        }
        public AccountListEdit(Flyout self)
        {
            this.InitializeComponent();
            flyoutSelf = self;
            this.DataContext = Frontend.Accounts;

            foreach (var account in Frontend.Accounts)
                account.forceDisabled = false;
        }
        public EditContact(Flyout self, Backend.Data.Contact contact)
        {
            this.InitializeComponent();
            CurrentContact = contact;
            this.DataContext = contact;
            flyoutSelf = self;

            if (CurrentContact != null)
            {
                if( string.IsNullOrEmpty(CurrentContact.name))
                    CurrentContact.name = "";

                this.Alias.Text = CurrentContact.name;
            }
        }
        public AccountEdit(Flyout self, object data)
        {
            this.InitializeComponent();
            flyoutSelf = self;

            if (data is AccountTemplate)
            {
                var template = (AccountTemplate)data;

                this.Jid.Text = template.Jid;
                this.Host.Text = template.Host;
                this.Port.Text = template.Port.ToString();
                this.SSL.IsOn = template.SSL;
                this.OldSSL.IsOn = template.OldSSL;
                this.Plain.IsOn = template.Plain;
                this.MD5.IsOn = template.MD5;
                this.SCRAM.IsOn = template.SCRAM;
            }
            else if (data is Account)
            {
                CurrentAccount = (Account)data;

                if (CurrentAccount != null)
                {
                    foreach (ComboBoxItem color in ColorSelector.Items)
                    {
                        if ((string)color.Tag == CurrentAccount.color)
                            ColorSelector.SelectedItem = color;
                    }

                    this.Title.Text = CurrentAccount.title;
                    this.Jid.Text = CurrentAccount.jid;
                    this.Password.Password = CurrentAccount.password;
                    this.Host.Text = CurrentAccount.host;
                    this.Port.Text = CurrentAccount.port.ToString();
                    this.SSL.IsOn = CurrentAccount.usesssl;
                    this.OldSSL.IsOn = CurrentAccount.oldstylessl;
                    this.Plain.IsOn = CurrentAccount.authplain;
                    this.MD5.IsOn = CurrentAccount.authmd5;
                    this.SCRAM.IsOn = CurrentAccount.authscram;
                    this.ConnectedStandby.IsOn = CurrentAccount.requestConnectedStandby;
                }
            }
        }
Exemple #6
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 #7
0
        public StatusEdit(Flyout self)
        {
            this.InitializeComponent();
            flyoutSelf = self;

            this.DataContext = Frontend.Status;

            CurrentStatus = Frontend.Status;

            if( CurrentStatus != null )
            {
                this.Avatar.AvatarImage = CurrentStatus.ImageData;
                this.Message.Text = CurrentStatus.message;

                foreach (ComboBoxItem status in StatusSelector.Items)
                {
                    if (Convert.ToInt32(status.Tag) == (int)CurrentStatus.status)
                        StatusSelector.SelectedItem = status;
                }

                if (StatusSelector.SelectedItem == null)
                    StatusSelector.SelectedItem = Offline;
            }
        }
 public Notifications(Flyout self)
 {
     this.InitializeComponent();
     flyoutSelf = self;
     this.DataContext = Frontend.Notifications.NotificationList;
 }
Exemple #9
0
 public ThemeEdit(Flyout self)
 {
     this.InitializeComponent();
     this.DataContext = Frontend.AppColors;
 }
Exemple #10
0
 public About(Flyout self)
 {
     this.InitializeComponent();
     this.flyoutSelf = self;
 }
Exemple #11
0
 public AddContact(Flyout self)
 {
     this.InitializeComponent();
     this.DataContext = Frontend.Accounts.Enabled;
     flyoutSelf = self;
 }
 public SettingsEdit(Flyout self)
 {
     this.InitializeComponent();
     this.DataContext = Frontend.Settings;
 }
Exemple #13
0
 public Notifications(Flyout self)
 {
     this.InitializeComponent();
     flyoutSelf       = self;
     this.DataContext = Frontend.Notifications.NotificationList;
 }