Note that there are some explanatory texts on larger screens.

plurals
  1. POBinding data to ComboBox WPF
    primarykey
    data
    text
    <p>I am newbie to WPF, and needs help to bind data into the ComboBox. The xaml file contains the tag below.</p> <pre><code>&lt;UserControl x:Class="SKAT.Postfordeler.Client.UI.View.ChooseInboxView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="42" d:DesignWidth="598"&gt; &lt;Grid&gt; &lt;StackPanel Orientation="Horizontal"&gt; &lt;ComboBox Name="_currentInbox" Width="180" Margin="5" Height="22" DataContext="{Binding}" /&gt; &lt;Label Content="Et job kører allerede i denne indbakke (1500 ud af 1700 poster behandlet)" Name="_currentProcess" Margin="5" Height="25" /&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; </code></pre> <p></p> <pre><code>//Inbox class , this class was implemented in seperate project namespace SKAT.Postfordeler.Shared.DataTypes { [DataContract] public class Inbox { [DataMember] public String Id { get; set; } [DataMember] public String Folder { get; set; } [DataMember] public Rule Rules { get; set; } } } //This code is located in the controller, the Activate method will fire when the MainWindow was executed public void Activate() { var configuration = _configurationManager.GetConfiguration();// this method gets the xaml file settings _chooseInboxView.FillInboxes(configuration.Inboxes); // Inboxes data binds to combobox } </code></pre> <p>and in the View code behind, I created a method to bind the data which contains a type of list</p> <pre><code>public void FillInboxes(List&lt;Inbox&gt; inboxes) { DataContext = inboxes; } </code></pre> <p>But it won't works,Any help please?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload