예제 #1
0
        void CreateFlyout(LayoutAwarePage mypane)
        {
            // Create a Popup window which will contain our flyout.
            settingsPopup                       = new Popup();
            settingsPopup.Closed               += OnPopupClosed;
            Window.Current.Activated           += OnWindowActivated;
            settingsPopup.IsLightDismissEnabled = true;
            settingsPopup.Width                 = settingsWidth;
            settingsPopup.Height                = windowBounds.Height;

            // Add the proper animation for the panel.
            settingsPopup.ChildTransitions = new TransitionCollection();
            settingsPopup.ChildTransitions.Add(new PaneThemeTransition()
            {
                Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ?
                       EdgeTransitionLocation.Right :
                       EdgeTransitionLocation.Left
            });

            // Create a SettingsFlyout the same dimensions as the Popup.

            mypane.Width  = settingsWidth;
            mypane.Height = windowBounds.Height;

            // Place the SettingsFlyout inside our Popup window.
            settingsPopup.Child = mypane;

            // Let's define the location of our Popup.
            settingsPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (windowBounds.Width - settingsWidth) : 0);
            settingsPopup.SetValue(Canvas.TopProperty, 0);
            settingsPopup.IsOpen = true;
        }
예제 #2
0
파일: App.xaml.cs 프로젝트: tadams1138/xkcd
        private void ShowFlyout(LayoutAwarePage mypane)
        {
            _settingsPopup                       = new Popup();
            _settingsPopup.Closed               += OnPopupClosed;
            Window.Current.Activated            += OnWindowActivated;
            _settingsPopup.IsLightDismissEnabled = true;
            _settingsPopup.Width                 = SettingsWidth;
            _settingsPopup.Height                = _windowBounds.Height;

            // Add the proper animation for the panel.
            _settingsPopup.ChildTransitions = new TransitionCollection
            {
                new PaneThemeTransition
                {
                    Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right)
                                       ? EdgeTransitionLocation.Right
                                       : EdgeTransitionLocation.Left
                }
            };

            // Create a SettingsFlyout the same dimenssions as the Popup.
            mypane.Width  = SettingsWidth;
            mypane.Height = _windowBounds.Height;

            // Place the SettingsFlyout inside our Popup window.
            _settingsPopup.Child = mypane;

            // Let's define the location of our Popup.
            _settingsPopup.SetValue(Canvas.LeftProperty,
                                    SettingsPane.Edge == SettingsEdgeLocation.Right ? (_windowBounds.Width - SettingsWidth) : 0);
            _settingsPopup.SetValue(Canvas.TopProperty, 0);
            _settingsPopup.IsOpen = true;
        }
        public PrinterJob(LayoutAwarePage rootPage, PrintJobType type, Reservation reservation)
        {
            _reservationForPrinting = reservation;
            _type = type;

            _rootPage                      = rootPage;
            _printDocument                 = new PrintDocument();
            _printDocumentSource           = _printDocument.DocumentSource;
            _printDocument.Paginate       += CreatePrintPreviewPages;
            _printDocument.GetPreviewPage += GetPrintPreviewPage;
            _printDocument.AddPages       += AddPrintPages;

            _printPreviewPages = new List <UIElement>();

            PrintManager printMan = PrintManager.GetForCurrentView();

            printMan.PrintTaskRequested += PrintTaskRequested;
        }
        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="navigationParameter">The parameter value passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested.
        /// </param>
        /// <param name="pageState">A dictionary of state preserved by this page during an earlier
        /// session.  This will be null the first time a page is visited.</param>
        protected override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState)
        {
            // TODO: Create an appropriate data model for your problem domain to replace the sample data
            var sampleItems = SampleDataSource.GetItems((String)navigationParameter);

            try
            {
                Assembly asm = typeof(MainPage).GetTypeInfo().Assembly;
                using (Stream stream = asm.GetManifestResourceStream("FlexChart101.Resources.SamplesCodes.zip"))
                {
                    using (C1ZipFile zip = new C1ZipFile(stream))
                    {
                        bool isMobileDevice = LayoutAwarePage.IsWindowsPhoneDevice();
                        sampleItems.ToList <SampleDataItem>().ForEach(sampleItem =>
                        {
                            var ets = zip.Entries.Where(entry => entry.FileName.Equals(sampleItem.SourceCodes.XamlFileName) ||
                                                        entry.FileName.Equals(sampleItem.SourceCodes.CodeFileName) ||
                                                        (entry.FileName.Contains("DeviceFamily-Mobile/")) && entry.FileName.Contains(sampleItem.SourceCodes.XamlFileName));
                            ets.ToList <C1ZipEntry>().ForEach(entry =>
                            {
                                if (entry.FileName.Contains("xaml.cs"))
                                {
                                    sampleItem.SourceCodes.Code = GetContent(entry);
                                }
                                else if (ets.Count() == 2 || (isMobileDevice && entry.FileName.Contains("DeviceFamily-Mobile/") ||
                                                              !isMobileDevice && !entry.FileName.Contains("DeviceFamily-Mobile/")))
                                {
                                    sampleItem.SourceCodes.Xaml = GetContent(entry);
                                }
                            });
                        });
                    }
                }
            }
            catch
            {
            }
            this.DefaultViewModel["AllItems"] = sampleItems;
        }
예제 #5
0
        void CreateFlyout(LayoutAwarePage mypane)
        {
            // Create a Popup window which will contain our flyout.
            settingsPopup = new Popup();
            settingsPopup.Closed += OnPopupClosed;
            Window.Current.Activated += OnWindowActivated;
            settingsPopup.IsLightDismissEnabled = true;
            settingsPopup.Width = settingsWidth;
            settingsPopup.Height = windowBounds.Height;

            // Add the proper animation for the panel.
            settingsPopup.ChildTransitions = new TransitionCollection();
            settingsPopup.ChildTransitions.Add(new PaneThemeTransition()
            {
                Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ?
                       EdgeTransitionLocation.Right :
                       EdgeTransitionLocation.Left
            });

            // Create a SettingsFlyout the same dimensions as the Popup.
            
            mypane.Width = settingsWidth;
            mypane.Height = windowBounds.Height;

            // Place the SettingsFlyout inside our Popup window.
            settingsPopup.Child = mypane;

            // Let's define the location of our Popup.
            settingsPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (windowBounds.Width - settingsWidth) : 0);
            settingsPopup.SetValue(Canvas.TopProperty, 0);
            settingsPopup.IsOpen = true;
        }