c# - How to handle a DataTemplate inside a tab? -


My name is Andrea This is my first post

Often you have made me as a simple reader I have been helped, now I am writing because I wanted to be dealt with support.

I have to create a tab control and add a tab with a button. I have to add a new tab to the same content. It's all right.

I have text editing and Cambodia within the tab I have two problems:

1 How do I load the contents of the combobox for each tab? 2 Every time I write text and override an edit tab, I also edit the text of another tab.

Code here:

Data template in XML:

  data templates x: key = "tabtime content" & gt; & Lt; Dxlc: Layout Group Orientation = "Vertical" Header = "Target Description" IsCollapsible = "True" & gt; & Lt; -! Name - & gt; & Lt; Dxlc: LayoutItem & gt; & Lt; Dxlc: Layout Group Orientation = "Horizontal" itemspace = "4" & gt; & Lt; Dxlc: layout item label = "name" margin = "10" & gt; & Lt; Dxe: TextEdit x: name = "TextEdit_NameTarget" /> & Lt; / Dxlc: LayoutItem & gt; & Lt; / Dxlc: LayoutGroup & gt; & Lt; / Dxlc: LayoutItem & gt; & Lt ;! - Country E-label - & gt; & Lt; Dxlc: LayoutItem & gt; & Lt; Dxlc: Layout Group Orientation = "Horizontal" itemspace = "12" & gt; & Lt; Dxlc: layout item label = "nation" margin = "10" & gt; & Lt; Combobox x: name = "combo box lodgegeon" /> & Lt; / Dxlc: LayoutItem & gt; & Lt; / Dxlc: LayoutGroup & gt; & Lt; / Dxlc: LayoutItem & gt; & Lt; / Dxlc: LayoutGroup & gt; & Lt; / DataTemplate & gt; Private Zero Button, Link (Object Sender, Routing Entrepreneur E) {Datamapplet TabTemmentDimet Template = this.TryFindResource ("tabItemContent") DataTemplate:  

C #:

  In form of; DXTabItem tabItem = New DXTabItem (); TabItem.Header = "new tab"; TabItem.ContentTemplate = tabItemDataTemplate; TabControl_Targets.Items.Add (TabItem); }  

Where to load this list in the cobobox:

  Private zero loadCombobox () {combo box NewJoin. ITMSSource = ManagementTrial.Estance (). Get_Nation_byTipologyAndContext ComboBoxTabologySenario Selected Itam. Toaster (), combo boxcontaxesenario Selected Itam. Toastring ()); Controlloselecteditem (ComboBox_SourceNazione.SelectedItem.ToString ()); Controlloselecteditem (ComboBox_TargetNazione.SelectedItem.ToString ()); }  

Thank you for your help, which you can give me.

The data template requires a simple but fundamental requirement for working properly: you approach Should use.

Ideally, your tab control should be bound to some videoland after that, if you want to show another tab, you can call command in your ViewModel You should use your button click, then Viewmodel will add another item to your tab control items source property (which will be stored), and the new item will be displayed "Automatically" with its Datatappleplate.

To see the idea of ​​WPF, it is to change all the mandatory code (as you have posted) more indirectly, where your only concern is to manipulate things in the view modal, and "dum View "is just like this.

Hope this helps, but do not hesitate to ask for additional details in the comments.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -