Esempio n. 1
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         VistaGlassHelper.ExtendGlass(this, -20, -20, -20, -20);
     }
     catch
     {
         this.Background = Brushes.White;
     }
 }
Esempio n. 2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         VistaGlassHelper.ExtendGlass(this, -3, -3, -3, -3);
     }
     // If not Vista, paint background white.
     catch //(DllNotFoundException)
     {
         this.Background = Brushes.White;
     }
 }
Esempio n. 3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                VistaGlassHelper.ExtendGlass(this, 2, 2, 2, 2);
            }
            catch
            {
                this.Background = System.Windows.Media.Brushes.White;
            }

            document.Load(@"E:\Project\TimeDeal\TimeDeal\TimeDeal\Th.xml");
        }
Esempio n. 4
0
        /// <summary>
        /// 窗体载入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Vista Glass效果
            try
            {
                VistaGlassHelper.ExtendGlass(this, -3, -3, -3, -3);
            }
            catch
            {
                this.Background = Brushes.White;
            }

            //初始化ListView_Music
            ListView_Bind();
        }
Esempio n. 5
0
        public static void ExtendGlass(Window win, int left, int right, int top, int bottom)
        {
            // Obtain the window handle for WPF application
            WindowInteropHelper windowInterop = new WindowInteropHelper(win);
            IntPtr     windowHandle           = windowInterop.Handle;
            HwndSource mainWindowSrc          = HwndSource.FromHwnd(windowHandle);

            mainWindowSrc.CompositionTarget.BackgroundColor = Colors.Transparent;

            VistaGlassHelper.Margins margins =
                VistaGlassHelper.GetDpiAdjustedMargins(windowHandle, left, right, top, bottom);

            int returnVal = VistaGlassHelper.DwmExtendFrameIntoClientArea(mainWindowSrc.Handle, ref margins);

            if (returnVal < 0)
            {
                throw new NotSupportedException("Operation failed.");
            }
        }
Esempio n. 6
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                VistaGlassHelper.ExtendGlass(this, -3, -3, -3, -3);
            }
            catch
            {
                this.Background = Brushes.White;
            }

            dt.Columns.Add("Title", typeof(string));
            dt.Columns.Add("Content", typeof(string));
            dt.Columns.Add("Time", typeof(string));
            dt.Columns.Add("Music", typeof(string));


            document.Load(@"E:\Project\TimeDeal\TimeDeal\TimeDeal\Th.xml");
            root = document.DocumentElement;

            listView1_Bind();
        }