第一天工作总结

C#    WPF第一天  新建WPF项目 将MainWindow.xaml中的Window改成NavigationWindow

还有public partial class MainWindow : Window修改成public partial class MainWindow : NavigationWindow

using System.Configuration;
using WPFServer;
using PhotoViewer;

namespace HelloWorld
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : NavigationWindow
    {
        public MainWindow()
        {
            InitializeComponent();
        }

 C#中的引用需要将引用项加入。

屏幕全屏设置

        private void NavigationWindow_Loaded(object sender, RoutedEventArgs e)
        {
           
            if (!Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["IsDebug"]))
            {

                //this.Topmost = true;
                this.Left = 0;
                this.Top = 0;

                //if (!Convert.ToBoolean(ConfigurationManager.AppSettings["FangXiang"]))
                //{
                this.Width = Toolkit.ScreenRectangle.Width;
                this.Height = Toolkit.ScreenRectangle.Height;
                //}
                //else
                //{
                //    this.Width = Toolkit.ScreenRectangle.Height;
                //    this.Height = Toolkit.ScreenRectangle.Width;
                //}

             

            }
            else
            {
                //this.Width = Convert.ToInt32(ConfigurationManager.AppSettings["Width"]);
                //this.Height = Convert.ToInt32(ConfigurationManager.AppSettings["Height"]);

                //全屏
                if (!this.IsFullscreen())
                    this.GoFullscreen();
            }


            //SystemHelper.CurrentWindow = this;
        }

点击esc退出程序

  private void NavigationWindow_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Escape)
                this.Close();
        }

窗口设置无  可以在axml的属性中进行设置。

 

 

posted on 2013-04-15 17:03  我是cw  阅读(192)  评论(0编辑  收藏  举报