Exemple #1
0
        public void onStoringSettings(Base.ISettings settings)
        {
            if (settings == null)
            {
                return;
            }
            var boxSettings    = Dispatcher.Invoke(() => PopupHelper.getUpdatedLocation(mybox));
            var popMsgSettings = Dispatcher.Invoke(() => getNewerSettings(popMsg));

            boxSettings.relativeTo(SystemParameters.WorkArea);
            popMsgSettings.relativeTo(SystemParameters.WorkArea);
            settings.put(Constant.FloatingboxKey, boxSettings);
            settings.put(Constant.FloatingPopMsgKey, popMsgSettings);
        }
        private void subscribeEvent(Base.ISettings settings)
        {
            RoutedEventHandler onLoaded = null;

            onLoaded = (sender, e) => {
                this.Loaded -= onLoaded;
                if (Owner != null)
                {
                    Owner.Closing += onOwnerClosing;
                }
                this.Top = 0;
                this.Hide();
                tvNormal  = TryFindResource("tv-normal") as PathGeometry;
                tvDisable = TryFindResource("tv-disable") as PathGeometry;
                var mode = settings.get(Constant.FlowBoxModeKey, false);
                toDisplayMode(mode);
                settings.put(Constant.FlowBoxModeKey, mode);
                setPopup(settings);
                setFlow(settings);

                /*mutexToggle = new List<ToggleButton>(new ToggleButton[] {
                 *  dloadDetailToggle,
                 *  recentToggle,
                 *  prefToggle
                 * });
                 * foreach(var toggle in mutexToggle) {
                 *  toggle.Checked += onWhoChecked;
                 * }*/
            };
            this.Loaded += onLoaded;
        }
        public void onStoringSettings(Base.ISettings settings)
        {
            if (settings == null)
            {
                return;
            }
            var location = Dispatcher.Invoke(() => {
                return(PopupHelper.getUpdatedLocation(popbox));
            });
            var flowChecked = Dispatcher.Invoke(() => flowToggle.IsChecked == true);

            location.relativeTo(SystemParameters.WorkArea);
            settings.put(Constant.FlowBoxKey, location);
            settings.put(Constant.FlowBoxOpenKey, flowChecked);
            settings.put(Constant.FlowBoxMaxRecentKey, msgHost.MaxRecentSize);
        }