コード例 #1
0
ファイル: PopupControl.xaml.cs プロジェクト: syatin003/Wpf
 public void ShowMessage(string message, MessageType status)
 {
     MessageTextBlock.Text = message;
     RootBorder.Background = (status == MessageType.Successful) ? _successfulColor : _failedColor;
     RootBorder.BringIntoView();
     AnimatePopup();
 }
コード例 #2
0
        public MainPage()
        {
            this.InitializeComponent();
            _compositor = ElementCompositionPreview.GetElementVisual(this).Compositor;

            _firstLoad = true;

            Loaded += (s, e) =>
            {
                if (Windows.System.UserProfile.UserProfilePersonalizationSettings.IsSupported())
                {
                    AutoWallpaperPanel.Visibility = Visibility.Visible;
                }

                RootBorder.SetupHostBlurBackground(((SolidColorBrush)App.Current.Resources["ApplicationPageBackgroundThemeBrush"]).Color);
            };

            //back button click event
            BackButton.Click += (s, e) =>
            {
                Frame rootFrame = Window.Current.Content as Frame;
                if (rootFrame.CanGoBack)
                {
                    rootFrame.GoBack();
                }
            };

            //setup title bar draggable region
            var coreTitleBar = CoreApplication.GetCurrentView().TitleBar;

            AppTitleBar.Height = coreTitleBar.Height;
            coreTitleBar.LayoutMetricsChanged += (s, args) => AppTitleBar.Height = coreTitleBar.Height;

            Window.Current.SetTitleBar(AppTitleBar);
        }
コード例 #3
0
ファイル: PopupControl.xaml.cs プロジェクト: syatin003/Wpf
        private void AnimatePopup()
        {
            SetPopUpProperties(40, 5, 1);
            var aminationOpacityShow = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(0.3));
            var aminationOpacityHide = new DoubleAnimation(1, 0, TimeSpan.FromSeconds(0.4))
            {
                BeginTime = TimeSpan.FromSeconds(1)
            };

            aminationOpacityShow.Completed += (sender, args) =>
                                              RootBorder.BeginAnimation(OpacityProperty, aminationOpacityHide);
            aminationOpacityHide.Completed += (sender, args) =>
                                              SetPopUpProperties(0, 0, 0);

            RootBorder.BeginAnimation(OpacityProperty, aminationOpacityShow);
        }
コード例 #4
0
        protected override void OnClosing(CancelEventArgs e)
        {
            e.Cancel = true;
            if (MgPopup.IsMouseOver)
            {
                return;
            }
            if (FpsUtilsPopup.IsMouseOver)
            {
                return;
            }
            var popupsOpen = MgPopup.IsOpen || FpsUtilsPopup.IsOpen;

            MgPopup.IsOpen       = false;
            FpsUtilsPopup.IsOpen = false;
            if (IsMouseOver && popupsOpen)
            {
                return;
            }

            FocusManager.PauseTopmost = false;
            RootBorder.BeginAnimation(OpacityProperty, _closeAnim);
        }
コード例 #5
0
        public ScrollingGraph()
        {
            InitializeComponent();

            RootBorder.SetBinding(Border.BackgroundProperty, new Binding()
            {
                Source = this, Path = new PropertyPath("Background")
            });
            RootBorder.SetBinding(Border.BorderBrushProperty, new Binding()
            {
                Source = this, Path = new PropertyPath("BorderBrush")
            });
            RootBorder.SetBinding(Border.BorderThicknessProperty, new Binding()
            {
                Source = this, Path = new PropertyPath("BorderThickness")
            });

            this.LayoutUpdated += Chart_LayoutUpdated;

            this.SizeChanged += ScrollingGraph_SizeChanged;

            this.Unloaded += ScrollingGraph_Unloaded;
        }
コード例 #6
0
 public void AnimateOpening()
 {
     RootBorder.BeginAnimation(OpacityProperty, _expandAnim);
 }
コード例 #7
0
 public void AnimateOpening()
 {
     Topmost = false;
     Topmost = true;
     RootBorder.BeginAnimation(OpacityProperty, _openAnim);
 }