Some issues with WPF Filefolderdialog and popup child windows

Source: Internet
Author: User

Abstract: This article is primarily about filefolderdialog in WPF, complementing the related properties (Data binding) and command bindings (Delegate) for popup child windows in the parent window , as well as child windows. Command), there is also a way to read and write XML file content.

Places to be aware of:

(1) For each window (parent window and child window), if it involves the Data Binding related problems, it is necessary to set their corresponding DataContext(generally for its ViewModel);

(2) For a property that is not initialized in the constructor, it needs to be instantiated at the time of definition (as follows:), otherwise the Property object will not be available;

Private Condition _queryconditions=New Condition ();     // It is important to create an instance object here  Public Condition queryconditions{     getreturn  _queryconditions;}      Set      {          = value;           this. raisePropertyChanged ("queryconditions");}      }

(3) The relative path is used as follows:

 Private voidAddpacsnode () {XmlDocument xmldoc=NewXmlDocument (); Xmldoc.load (@".. \.. \data\pacsconfig.xml");//relative Path//xmldoc.load (@ "C:\Users\Administrator\Documents\Visual Studio 2015\projects\day5\testopenfiledialog\  Testopenfiledialog\data\pacsconfig.xml "); //Absolute PathXmlNode root = Xmldoc.selectsinglenode ("PACS");//Find <PACS>XmlElement xe1 = xmldoc.createelement ("Pacsnode");//Create a <PacsNode> nodeXmlElement xesub1 = xmldoc.createelement ("Aetitle"); Xesub1. InnerText= Tempdataview.aetitle;//Set the text nodeXe1. AppendChild (XESUB1);//Add to <book> nodeXmlElement xesub2 = xmldoc.createelement ("HostIP"); Xesub2. InnerText=Tempdataview.hostip; Xe1.            AppendChild (XESUB2); XmlElement xesub3= Xmldoc.createelement ("Port"); Xesub3. InnerText=Tempdataview.port; Xe1.            AppendChild (XESUB3); XmlElement XESUB4= Xmldoc.createelement ("HostName"); Xesub4. InnerText=Tempdataview.hostname; Xe1.            AppendChild (XESUB4); Root.                           AppendChild (XE1); //Add to <bookstore> nodeXmldoc.save (@".. \.. \data\pacsconfig.xml");//relative Path             This.        LoadData (); }

Related Code address: Http://pan.baidu.com/s/1bpwuJi3

Some issues with WPF Filefolderdialog and popup child windows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.