首页 > 其他分享 >WPF 备忘录

WPF 备忘录

时间:2024-08-08 18:50:03浏览次数:4  
标签:Application StartupEventArgs 应用程序 备忘录 OnStartup close WPF

关于WPF元素的官方文档

目录

Application

WPF中的Application对象用来进行一些全局的行为和操作,并且每个 Domain (应用程序域)中仅且只有一个 Application 实例存在。WPF Application默认由两部分组成 : App.xaml 和 App.xaml.cs,这有点类似于 Asp.Net WebForm,将定义和行为代码相分离。

微软把WPF中经常使用的功能都封装在 Application 类中了。 Application 类具体有以下功能:

跟踪应用程序的生存期并与之交互。
检索和处理命令行参数。
检测和响应未经处理的异常。
共享应用程序范围的属性和资源。
管理独立应用程序中的窗口。
跟踪和管理导航。

OnStartup(StartupEventArgs e)

原型:protected virtual void OnStartup (System.Windows.StartupEventArgs e);

A type that derives from Application may override OnStartup. The overridden method must call OnStartup in the base class if the Startup event needs to be raised.
如果需要出发Startup事件,这必须调用base.OnStartup(e)

Window

官方文档

event

Window.Closing Event

这个是一个窗口事件,但是在xmal文件中并没有定义,可以说是自带的.作用是可以在Close事件前,进行取消处理.close和closing 是不同的事件,唯一的区别可以理解为closing可以在触发close之前进行调用,以至于可以取消close操作.

在用户关闭窗口的时候,其实并不是真正的关闭.而是最小化.

DataGrid

标签:Application,StartupEventArgs,应用程序,备忘录,OnStartup,close,WPF
From: https://www.cnblogs.com/newy/p/17061274.html

相关文章

  • DevExpress WPF中文教程:如何在GridControl中对数据排序、分组、过滤?
    DevExpressWPF拥有120+个控件和库,将帮助您交付满足甚至超出企业需求的高性能业务应用程序。通过DevExpressWPF能创建有着强大互动功能的XAML基础应用程序,这些应用程序专注于当代客户的需求和构建未来新一代支持触摸的解决方案。无论是Office办公软件的衍伸产品,还是以数据为中心......
  • WPF PopUp的简单使用
    <Windowx:Class="WpfApp1.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.c......
  • wpf 中的三个 UnhandledException
    结构化异常处理在异常点生成异常的结构体,异常分发WPF中的三个Excption处理函数AppDomain::UnhandledException事件属性UI线程和Thread实例的异常会触发该事件。Application::DispatcherUnhandledExcetion事件属性UI线程异常会触发该事件。如果事件的IsHandle=false,异......
  • 第十四章 -------------------WPF 和MVVM实战
    我的感悟:在编程时我刚开始是使用的MFC,现在回想起来当时我是怎么把程序运行起来的,我记得我当时是在View里面操作数据,在View里面操作Fream。可以说是糟糕的一塌糊涂,后期维护也是相当困难,这一点我现在回想起来想吐。------------------------------------------------------------......
  • WPF KeyDown MVVM via CallMethodAction of behavior
    <behavior:Interaction.Triggers><behavior:EventTriggerEventName="KeyDown"><behavior:CallMethodActionMethodName="WinKeyDown"TargetObject="{Binding}"/></behavior:EventTrigger>&......
  • WPF Window.InputBindings KeyBinding Key
    //xaml<Windowx:Class="WpfApp233.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.mi......
  • WPFUI报错 - page does not have a parameterless constructor
    WPFUI报错pagedoesnothaveaparameterlessconstructor.IfyouareusingWpf.Ui.IPageServicedonotnavigateinitiallyanddon'tuseCacheorPrecache问题原因WPFUI中的NavigationView只支持导航页面的无参构造函数或含一个dataContext的有参构造函数。因为在View......
  • WPF DataGrid Checkbox column to implement select and unselect items explicitly v
    <DataGridTemplateColumnHeader="Select"><DataGridTemplateColumn.CellTemplate><DataTemplate><CheckBoxIsThreeState="False"><behavior:Interaction.Triggers>......
  • WPF ScrollViewer控件 触屏滑动
    备份下  原文 https://www.cnblogs.com/webenh/p/18207292<ScrollViewerx:Name="scroll"TouchDown="mScrollViewer_TouchDown"TouchMove="mScrollViewer_TouchMove"TouchUp="mScrollViewer_TouchUp"></ScrollViewer>......
  • WPF的容器控件之Gird
    WPF的容器控件之GirdGrid顾名思义就是“网格”,以表格形式布局元素,对于整个面板上的元素进行布局,它的子控件被放在一个一个事先定义好的小格子里面,整齐配列。Grid和其他各个Panel比较起来,功能最多也最为复杂。要使Grid,首先要向RowDefinitions和ColumnDefinitions属性中添加......