예제 #1
0
        private void saveConfig_clicked(object sender, RoutedEventArgs e)
        {
            DeviceTreeViewModel dtvm = (DeviceTreeViewModel)deviceTree.DataContext;
            string xmlConfig         = XMLHelper <List <DeviceTreeModel> > .objectToXml(dtvm.ListDeviceTreeModel);

            XMLHelper <List <DeviceTreeModel> > .saveFile("config.xml", xmlConfig);
        }
예제 #2
0
        public DeviceTreeView()
        {
            InitializeComponent();

            // call dummy mouse down to disable the context menus
            tree_MouseDown(null, null);

            DeviceTreeViewModel dtvm = new DeviceTreeViewModel();

            dtvm.init(this);
            DataContext = dtvm;

            contextMenu.init(this);
        }