Search Results

Search found 94094 results on 3764 pages for 'wpf user'.

Page 9/3764 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • WPF Focus In Tab Control Content When New Tab is Created

    - by Phil Sandler
    I've done a lot of searching on SO and google around this problem, but can't seem to find anything else to try. I have a MainView (window) that contains a tab control. The tab control binds to an ObservableCollection of ChildViews (user controls). The MainView's ViewModel has a method that allows adding to the collection of ChildViews, which then creates a new tab. When a new tab is created, it becomes the active tab, and this works fine. This method on the MainView is called from another ViewModel (OtherViewModel). What I am trying to do is set the keyboard focus to the first control on the tab (an AutoCompleteBox from WPFToolkit*) when a new tab is created. I also need to set the focus the same way, but WITHOUT creating a new tab (so set the focus on the currently active tab). (*Note that there seem to be some focus problems with the AutoCompleteBox--even if it does have focus you need to send a MoveNext() to it to get the cursor in its window. I have worked around this already). So here's the problem. The focusing works when I don't create a new tab, but it doesn't work when I do create a new tab. Both functions use the same method to set focus, but the create logic first calls the method that creates a new tab and sets it to active. Code that sets the focus (in the ChildView's Codebehind): IInputElement element1 = Keyboard.Focus(autoCompleteBox); //plus code to deal with AutoCompleteBox as noted. In either case, the Keyboard.FocusedElement starts out as the MainView. After a create, calling Keyboard.Focus seems to do nothing (focused element is still the MainView). Calling this without creating a tab correctly sets the keyboard focus to autoCompleteBox. Any ideas? Update: Bender's suggestion half-worked. So now in both cases, the focused element is correctly the AutoCompleteBox. What I then do is MoveNext(), which sets the focus to a TextBox. I have been assuming that this Textbox is internal to the AutoCompleteBox, as the focus was correctly set on screen when this happened. Now I'm not so sure. This is still the behavior I see when this code gets hit when NOT doing a create. After a create, MoveNext() sets the focus to an element back in my MainView. The problem must still be along the lines of Bender's answer, where the state of the controls is not the same depending on whether a new tab was created or not. Any other thoughts?

    Read the article

  • Create a grid in WPF as Template programmatically

    - by wickie79
    I want to create a basic user control with a style programmatically. In this style i want to add a Grid (no problem), but i dont can add column definitions to this grid. My example code is ControlTemplate templ = new ControlTemplate(); FrameworkElementFactory mainPanel = new FrameworkElementFactory(typeof(DockPanel)); mainPanel.SetValue(DockPanel.LastChildFillProperty, true); FrameworkElementFactory headerPanel = new FrameworkElementFactory(typeof(StackPanel)); headerPanel.SetValue(StackPanel.OrientationProperty, Orientation.Horizontal); headerPanel.SetValue(DockPanel.DockProperty, Dock.Top); mainPanel.AppendChild(headerPanel); FrameworkElementFactory headerImg = new FrameworkElementFactory(typeof(Image)); headerImg.SetValue(Image.MarginProperty, new Thickness(5)); headerImg.SetValue(Image.HeightProperty, 32d); headerImg.SetBinding(Image.SourceProperty, new Binding("ElementImage") { RelativeSource = new RelativeSource(RelativeSourceMode.TemplatedParent) }); headerPanel.AppendChild(headerImg); FrameworkElementFactory headerTitle = new FrameworkElementFactory(typeof(TextBlock)); headerTitle.SetValue(TextBlock.FontSizeProperty, 16d); headerTitle.SetValue(TextBlock.VerticalAlignmentProperty, VerticalAlignment.Center); headerTitle.SetBinding(TextBlock.TextProperty, new Binding("Title") { RelativeSource = new RelativeSource(RelativeSourceMode.TemplatedParent) }); headerPanel.AppendChild(headerTitle); FrameworkElementFactory mainGrid = new FrameworkElementFactory(typeof(Grid)); FrameworkElementFactory c1 = new FrameworkElementFactory(typeof(ColumnDefinition)); c1.SetValue(ColumnDefinition.WidthProperty, new GridLength(1, GridUnitType.Star)); FrameworkElementFactory c2 = new FrameworkElementFactory(typeof(ColumnDefinition)); c2.SetValue(ColumnDefinition.WidthProperty, new GridLength(1, GridUnitType.Auto)); FrameworkElementFactory c3 = new FrameworkElementFactory(typeof(ColumnDefinition)); c3.SetValue(ColumnDefinition.WidthProperty, new GridLength(3, GridUnitType.Star)); FrameworkElementFactory colDefinitions = new FrameworkElementFactory(typeof(ColumnDefinitionCollection)); colDefinitions.AppendChild(c1); colDefinitions.AppendChild(c2); colDefinitions.AppendChild(c3); mainGrid.AppendChild(colDefinitions); mainPanel.AppendChild(mainGrid); FrameworkElementFactory content = new FrameworkElementFactory(typeof(ContentPresenter)); content.SetBinding(ContentPresenter.ContentProperty, new Binding() { RelativeSource = new RelativeSource(RelativeSourceMode.TemplatedParent), Path = new PropertyPath("Content") }); mainGrid.AppendChild(content); templ.VisualTree = mainPanel; Style mainStyle = new Style(); mainStyle.Setters.Add(new Setter(UserControl.TemplateProperty, templ)); this.Style = mainStyle; But the creation of FrameworkElementFactory with type ColumnDefinitionCollection will throw an exception "'ColumnDefinitionCollection' type must derive from FrameworkElement, FrameworkContentElement, or Visual3D." Who can help me?

    Read the article

  • WPF: Binding to ObservableCollection in ControlTemplate is not updated

    - by Julian Lettner
    I created a ControlTemplate for my custom control MyControl. MyControl derives from System.Windows.Controls.Control and defines the following property public ObservableCollection<MyControl> Children{ get; protected set; }. To display the nested child controls I am using an ItemsControl (StackPanel) which is surrounded by a GroupBox. If there are no child controls, I want to hide the GroupBox. Everything works fine on application startup: The group box and child controls are shown if the Children property initially contained at least one element. In the other case it is hidden. The problem starts when the user adds a child control to an empty collection. The GroupBox's visibility is still collapsed. The same problem occurs when the last child control is removed from the collection. The GroupBox is still visible. Another symptom is that the HideEmptyEnumerationConverter converter does not get called. Adding/removing child controls to non empty collections works as expected. Whats wrong with the following binding? Obviously it works once but does not get updated, although the collection I am binding to is of type ObservableCollection. <!-- Converter for hiding empty enumerations --> <Common:HideEmptyEnumerationConverter x:Key="hideEmptyEnumerationConverter"/> <!--- ... ---> <ControlTemplate TargetType="{x:Type MyControl}"> <!-- ... other stuff that works ... --> <!-- Child components --> <GroupBox Header="Children" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Children, Converter={StaticResource hideEmptyEnumerationConverter}}"> <ItemsControl ItemsSource="{TemplateBinding Children}"/> </GroupBox> </ControlTemplate> . [ValueConversion(typeof (IEnumerable), typeof (Visibility))] public class HideEmptyEnumerationConverter : IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { int itemCount = ((IEnumerable) value).Cast<object>().Count(); return itemCount == 0 ? Visibility.Collapsed : Visibility.Visible; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } #endregion } Another, more general question: How do you guys debug bindings? Found this (http://bea.stollnitz.com/blog/?p=52) but still I find it very hard to do. I am glad for any help or suggestion.

    Read the article

  • Visibility.Collapse does not work in WPF

    - by nitin
    Visibility.Collapse doesnt work in my case. below is the XAML. If i try to hide the lblCountry and cmbCountry a white space is shown between zip and practice fields. There is no option to hide an entire row of a Grid. <Grid> <Canvas Name="canDemographic" > </Canvas> <Grid HorizontalAlignment="Center" VerticalAlignment="Center"> <Grid.ColumnDefinitions> <ColumnDefinition Width="auto"/> <ColumnDefinition Width="auto"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="40"/> <RowDefinition Height="40" /> <RowDefinition Height="40" /> <RowDefinition Height="40" /> <RowDefinition Height="40" /> <RowDefinition Height="40"/> <RowDefinition Height="40"/> <RowDefinition Height="40"/> <RowDefinition Height="40"/> <RowDefinition Height="40"/> <RowDefinition Height="40"/> <RowDefinition Height="40"/> <RowDefinition Height="40"/> </Grid.RowDefinitions> <TextBlock Width="800" Height="50" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="Arial" FontSize="30" FontWeight="Bold" Visibility="Collapsed"> Please review or enter your user information details: </TextBlock> <TextBlock Width="200" Height="30" Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold"> *First Name: </TextBlock> <TextBlock Width="200" Height="30" Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Text=" Middle Name:"></TextBlock> <TextBlock Width="200" Height="30" Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold"> *Last Name: </TextBlock> <TextBlock Name="tbEmail" Width="200" Height="30" Grid.Column="0" Grid.Row="12" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold"> *Email Address: </TextBlock> <TextBlock Width="200" Height="30" Grid.Column="0" Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold"> *Address1: </TextBlock> <TextBlock Width="200" Height="30" Grid.Column="0" Grid.Row="6" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Text=" Address2:"></TextBlock> <TextBlock Width="200" Height="30" Grid.Column="0" Grid.Row="7" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold"> *City: </TextBlock> <TextBlock Width="200" Height="30" Grid.Column="0" Grid.Row="8" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold"> *State: </TextBlock> <TextBlock Width="200" Height="30" Grid.Column="0" Grid.Row="9" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold"> *Zip: </TextBlock> <TextBlock Name="lblCountry" Width="200" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="10" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Text=" *Country:" Visibility="Collapsed"="></TextBlock> <TextBlock Width="200" Height="30" Grid.Column="0" Grid.Row="11" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Text=" Practice/Affiliation:"></TextBlock> <!-- Input fields --> <TextBox Name="txtFirstName" Width="200" Height="30" Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" MaxLength="20" TextChanged="txtFirstName_TextChanged" IsEnabled="True" /> <TextBox Name="txtMiddleName" Width="200" Height="30" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Grid.Column="1" Grid.Row="3" MaxLength="10" IsEnabled="True" /> <TextBox Name="txtLastName" Width="200" Height="30" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Grid.Column="1" Grid.Row="4" MaxLength="20" TextChanged="txtLastName_TextChanged" /> <TextBox Name="txtEmail" Width="200" Height="30" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Grid.Column="1" Grid.Row="12" MaxLength="100"/> <TextBox Name="txtAddress1" Width="200" Height="30" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Grid.Column="1" Grid.Row="5" MaxLength="100" TextChanged="txtAddress1_TextChanged" /> <TextBox Name="txtAddress2" Width="200" Height="30" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Grid.Column="1" Grid.Row="6" MaxLength="100"/> <TextBox Name="txtCity" Width="200" Height="30" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Grid.Column="1" Grid.Row="7" MaxLength="50" TextChanged="txtCity_TextChanged" /> <TextBox Name="txtState" Width="200" Height="30" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Grid.Column="1" Grid.Row="8" MaxLength="50" TextChanged="txtState_TextChanged" /> <TextBox Name="txtZip" Width="200" Height="30" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Grid.Column="1" Grid.Row="9" MaxLength="50" TextChanged="txtZip_TextChanged" /> <ComboBox Name="cmbCountry" Width="200" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Grid.Column="0" Grid.Row="10" Grid.ColumnSpan="2" SelectionChanged="cmbCountry_SelectionChanged" ItemsSource="{Binding}" Visibility="Collapsed" /> <TextBox Name="txtPractice" Width="200" Height="30" VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Arial" FontSize="18" FontWeight="Bold" Grid.Column="1" Grid.Row="11" MaxLength="50"/> </Grid> <Button Name="btnExit" Height="30" VerticalAlignment="Bottom" Width="100" HorizontalAlignment="Left" Margin="21,0,0,12" BorderThickness="1" FontFamily="arial" Background="LightGray" FontSize="12pt" FontWeight="Bold" Click="btnExit_Click">Back</Button> <Button Name="btnNext" Height="30" VerticalAlignment="Bottom" Width="100" HorizontalAlignment="Right" Margin="0,0,21,12" BorderThickness="1" FontFamily="arial" Background="LightGray" FontSize="12pt" FontWeight="Bold" Click="btnNext_Click" IsEnabled="False" >Next</Button> </Grid> </ScrollViewer>

    Read the article

  • DoubleAnimation in ScaleTransform

    - by Adam S
    I'm trying, as an exhibition, to use a DoubleAnimation on the ScaleX and ScaleY properties of a ScaleTransform. I have a rectangle (144x144) which I want to make rectangular over five seconds. My XAML: <Window x:Class="ScaleTransformTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" Loaded="Window_Loaded"> <Grid> <Rectangle Name="rect1" Width="144" Height="144" Fill="Aqua"> <Rectangle.RenderTransform> <ScaleTransform ScaleX="1" ScaleY="1" /> </Rectangle.RenderTransform> </Rectangle> </Grid> </Window> My C#: private void Window_Loaded(object sender, RoutedEventArgs e) { ScaleTransform scaly = new ScaleTransform(1, 1); rect1.RenderTransform = scaly; Duration mytime = new Duration(TimeSpan.FromSeconds(5)); Storyboard sb = new Storyboard(); DoubleAnimation danim1 = new DoubleAnimation(1, 1.5, mytime); DoubleAnimation danim2 = new DoubleAnimation(1, 0.5, mytime); sb.Children.Add(danim1); sb.Children.Add(danim2); Storyboard.SetTarget(danim1, scaly); Storyboard.SetTargetProperty(danim1, new PropertyPath(ScaleTransform.ScaleXProperty)); Storyboard.SetTarget(danim2, scaly); Storyboard.SetTargetProperty(danim2, new PropertyPath(ScaleTransform.ScaleYProperty)); sb.Begin(); } Unfortunately, when I run this program, it does nothing. The rectangle stays at 144x144. If I do away with the animation, and just ScaleTransform scaly = new ScaleTransform(1.5, 0.5); rect1.RenderTransform = scaly; it will elongate it instantly, no problem. There is a problem elsewhere. Any suggestions? I have read the discussion at http://www.eggheadcafe.com/software/aspnet/29220878/how-to-animate-tofrom-an.aspx in which someone seems to have gotten a pure-XAML version working, but the code is not shown there. EDIT: At http://stackoverflow.com/questions/2131797/applying-animated-scaletransform-in-code-problem it seems someone had a very similar problem, I am fine with using his method that worked, but what the heck is that string thePath = "(0).(1)[0].(2)"; all about? What are those numbers representing?

    Read the article

  • How to delay the Setter to be in affect for 0.5 sec in DataTrigger ?

    - by vladc77
    I am wondering if it possible to delay a datatrigger to change layout for 0.5 a second. Is any easy way to do it? I need to set the visibility of the object but wait for 0.5 a second. Any adeas are highly appreciated. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBox}}, Path=SelectedItem.Attributes[retract].Value}" Value="True"> <Setter TargetName="ListboxIemtextBlock" Property="Visibility" Value="Hidden" /> </DataTrigger>

    Read the article

  • Podcast: The Invisible UI : Natural User Interfaces with Josh Blake

    - by craigshoemaker
    Josh Blake of Infostrat joins Pixel8 to discuss NUI development in .NET. Josh is the author of the upcoming book Multitouch on Windows from Manning. Reaching far beyond theory and the niche market of Microsoft Surface, NUI development is now possible with Silverlight and WPF development on Windows 7 and Windows 7 Mobile devices. Subscribe to the podcast! The Natural User Interface (NUI) was a prominent force at MIX10. What is NUI? Wikipedia defines it as: Natural user interface, or NUI, is the common parlance used by designers and developers of computer interfaces to refer to a user interface that is effectively invisible, or becomes invisible with successive learned interactions, to its users. The word natural is used because most computer interfaces use artificial control devices whose operation has to be learned. A NUI relies on a user being able to carry out relatively natural motions, movements or gestures that they quickly discover control the computer application or manipulate the on-screen content. The most descriptive identifier of a NUI is the lack of a physical keyboard and/or mouse. In our interview Josh demystifies what NUI is, makes a distinction between gestures and manipulations, and talks about what is possible today for NUI development. For more from Josh make sure to check out his book: and watch his MIX Presentation: Developing Natural User Interfaces with Microsoft Silverlight and WPF 4 Touch Resources Mentioned in the Show Check out the following videos that show the roots and future of NUI development: Jeff Han's Multi-Touch TED Presentation Microsoft Surface Project Natal MIX10 Day 2 Keynote A few times during our talk Bill Buxton’s work is mentioned. To see his segment of the MIX10 day 2 keynote, click below:

    Read the article

  • Interpretation of empty User-agent

    - by Amit Agrawal
    How should I interpret a empty User-agent? I have some custom analytics code and that code has to analyze only human traffic. I have got a working list of User-agents denoting human traffic, and bot traffic, but the empty User-agent is proving to be problematic. And I am getting lots of traffic with empty user agent - 10%. Additionally - I have crafted the human traffic versus bot traffic user agent list by analyzing my current logs. As such I might be missing a lot of entries in there. Is there a well maintained list of user agents denoting bot traffic, OR the inverse a list of user agents denoting human traffic?

    Read the article

  • Set focus on textbox in WPF from view model (C#) & wPF

    - by priyanka.sarkar
    I have a TextBox and a Button in my view. Now I am checking a condition upon button click and if the condition turns out to be false, displaying the message to the user, and then I have to set the cursor to the text box control. if (companyref == null) { Lipper.Nelson.AdminClient.Main.Views.ContactPanels.CompanyAssociation cs = new Lipper.Nelson.AdminClient.Main.Views.ContactPanels.CompanyAssociation(); MessageBox.Show("Company does not exist.", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation); cs.txtCompanyID.Focusable = true; System.Windows.Input.Keyboard.Focus(cs.txtCompanyID); } The above code is in the view model. The CompanyAssociation is the view name. But the cursor is not getting set in the TextBox. The xaml is as under <igEditors:XamTextEditor KeyDown="xamTextEditorAllowOnlyNumeric_KeyDown" Name="txtCompanyID" ValueChanged="txtCompanyID_ValueChanged" Text="{Binding Company.CompanyId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="{Binding ActualWidth, ElementName=border}" Grid.Column="1" Grid.Row="0" VerticalAlignment="Top" Margin="0,5,0,0" HorizontalAlignment="Stretch" IsEnabled="{Binding Path=IsEditable}" /> <Button Template="{StaticResource buttonTemp1}" Command="{Binding ContactCommand}" CommandParameter="searchCompany" Content="Search" Width="80" Grid.Column="2" Grid.Row="0" VerticalAlignment="Top" Margin="0" HorizontalAlignment="Left" IsEnabled="{Binding Path=IsEditable}" /> Please help

    Read the article

  • An open source WPF report engine that gets benefits from the current WPF controls,

    WPF changes the things greatly by providing the capability of printing Visual objects. It persuades many people to setup an open source report engine as in this article.  read moreBy Siyamand AyubiDid you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Examples of WPF forms for usual CRUD scenarios

    - by MicMit
    There are plenty of such examples shown for Silverlight at recent Microsoft conferences ( Creating amazing LOB applications in SL 2,3,4 ... ) . They even invented DataForms starting from Silverlight varsion 3. Basically I need an example of grid view ( maybe with possibility to filter, preferably DataGrid control ) from which we may update/delete selected record(s) or add new ones working against SQL Server database without service layer.

    Read the article

  • Wpf Combobox in Master/Detail MVVM

    - by isak
    I have MVVM master /details like this: <Window.Resources> <DataTemplate DataType="{x:Type model:EveryDay}"> <views:EveryDayView/> </DataTemplate> <DataTemplate DataType="{x:Type model:EveryMonth}"> <views:EveryMonthView/> </DataTemplate> </Window.Resources> <Grid> <ListBox Margin="12,24,0,35" Name="schedules" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Path=Elements}" SelectedItem="{Binding Path=CurrentElement}" DisplayMemberPath="Name" HorizontalAlignment="Left" Width="120"/> <ContentControl Margin="168,86,32,35" Name="contentControl1" Content="{Binding Path=CurrentElement.Schedule}" /> <ComboBox Height="23" Margin="188,24,51,0" Name="comboBox1" VerticalAlignment="Top" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Path=Schedules}" SelectedItem="{Binding Path=CurrentElement.Schedule}" DisplayMemberPath="Name" SelectedValuePath="ID" SelectedValue="{Binding Path=CurrentElement.Schedule.ID}" /> </Grid> This Window has DataContext class: public class MainViewModel : INotifyPropertyChanged { public MainViewModel() { _elements.Add(new Element("first", new EveryDay("First EveryDay object"))); _elements.Add(new Element("second", new EveryMonth("Every Month object"))); _elements.Add(new Element("third", new EveryDay("Second EveryDay object"))); _schedules.Add(new EveryDay()); _schedules.Add(new EveryMonth()); } private ObservableCollection<ScheduleBase> _schedules = new ObservableCollection<ScheduleBase>(); public ObservableCollection<ScheduleBase> Schedules { get { return _schedules; } set { _schedules = value; this.OnPropertyChanged("Schedules"); } } private Element _currentElement = null; public Element CurrentElement { get { return this._currentElement; } set { this._currentElement = value; this.OnPropertyChanged("CurrentElement"); } } private ObservableCollection<Element> _elements = new ObservableCollection<Element>(); public ObservableCollection<Element> Elements { get { return _elements; } set { _elements = value; this.OnPropertyChanged("Elements"); } } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged(string propertyName) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(propertyName)); } } #endregion } One of Views: <UserControl x:Class="Views.EveryDayView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Grid > <GroupBox Header="Every Day Data" Name="groupBox1" VerticalAlignment="Top"> <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <TextBox Name="textBox2" Text="{Binding Path=AnyDayData}" /> </Grid> </GroupBox> </Grid> I have problem with SelectedItem in ComboBox.It doesn't works correctly.

    Read the article

  • Starting an animation from the ViewModel in WPF/MVVM

    - by RandomEngy
    I'm writing a MVVM app and have started putting in a few animations. I want to call something on the ViewModel which starts the a storyboard. This blog had a promising approach to it, but it doesn't actually work. The IDChanged handler never fires for some reason. I also found that you could start animations on EventTriggers, but I don't know how to raise one on the ViewModel.

    Read the article

  • Binding Listbox ItemsSource to property of ViewModel in DataContext in WPF

    - by joshperry
    I have a simple ViewModel like: public class MainViewModel { public MainViewModel() { // Fill collection from DB here... } public ObservableCollection<Projects> ProjectList { get; set; } } I set the window's DataContext to a new instance of that ViewModel in the constructor: public MainWindow() { this.DataContext = new MainViewModel(); } Then in the Xaml I am attempting to bind the ItemsSource of a ListBox to that ProjectList property. Binding just ItemsSource like so doesn't work: <ListBox ItemsSource="{Binding ProjectList}" ItemTemplate="..." /> But if I first rebase the DataContext this works: <ListBox DataContext="{Binding ProjectList}" ItemsSource="{Binding}" ItemTemplate="..." /> Shouldn't the first method work properly? What am I doing wrong?

    Read the article

  • WPF - simple relative path - FindAncestor

    - by user309392
    In the XAML below the ToolTip correctly binds to RelativeSource Self. However, I can't for the life of me work out how to get the TextBlock in the commented block to refer to SelectedItem.Description <Controls:RadComboBoxWithCommand x:Name="cmbPacking" Grid.Row="2" Grid.Column="5" ItemsSource="{Binding PackingComboSource}" DisplayMemberPath="DisplayMember" SelectedValuePath="SelectedValue" SelectedValue="{Binding ElementName=dataGrid1, Path=SelectedItem.PackingID}" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem.Description}" IsSynchronizedWithCurrentItem="True" Style="{StaticResource comboBox}"> <!-- <Controls:RadComboBoxWithCommand.ToolTip>--> <!-- <TextBlock Text="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem.Description}" TextWrapping="Wrap" Width="50"/>--> <!-- </Controls:RadComboBoxWithCommand.ToolTip>--> </Controls:RadComboBoxWithCommand> I would appreciate any suggestions Thanks - Jeremy

    Read the article

  • Wpf: Storyboard.TargetName works, but Setter TargetName doesn't.

    - by MainMa
    Hi, Let's say we have a XAML code like this: <Style TargetType="{x:Type ListBoxItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListBoxItem}"> <Border HorizontalAlignment="Center" VerticalAlignment="Center"> <Border.LayoutTransform> <!--We are rotating randomly each image. Selected one will be rotated to 45°.--> <RotateTransform Angle="{Binding RandomAngle}" x:Name="globalRotation"/> </Border.LayoutTransform> <Grid> <Image Source="{Binding ImageLocation}" Stretch="None" /> <TextBlock x:Name="title" Text="{Binding Title}" /> </Grid> </Border> <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter TargetName="title" Property="Visibility" Value="Visible"/> <!--The next line will not compile.--> <Setter TargetName="globalRotation" Property="Angle" Value="45"/> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <!--This compiles well.--> <DoubleAnimation Storyboard.TargetName="globalRotation" Storyboard.TargetProperty="Angle" To="45" Duration="00:00:03"/> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> This code is intended to display a set of images in a listbox. Each image has a random rotation, but when selected, rotates to 45 degrees. Rotating selected image through a storyboard works well. I just specify Storyboard.TargetName and it rotates the image when selected (Trigger.ExitActions is omitted to make the code shorter). Now, if I want, instead of using a storyboard, assign 45 degrees value directly, I can't do that, because <Setter TargetName="globalRotation" Property="Angle" Value="45"/>: it compiles with "Cannot find the Trigger target 'globalRotation'. (The target must appear before any Setters, Triggers, or Conditions that use it.)" error. What happens? I suppose that Storyboard.TargetName is evaluated during runtime, so let me compile it. Is it right? How to make it work with just a setter, without using a storyboard?

    Read the article

  • WPF - Only want one expander open at a time in grouped Listbox

    - by Portsmouth
    I have a UserControl with a templated grouped listbox with expanders and only want one expander open at any time. I have browsed through the site but haven't found anything except binding the IsExpanded to IsSelected which isn't quite what I want. I am trying to put some code in the Expanded event that would loop through Expanders and close all the ones that aren't the expander passed in the Expanded event. I can't seem to figure out how to get at them. I've tried ListBox.Items.Groups but didn't see how to get at them and tried ListBox.ItemContainerGenerator.ContainerFromItem (or Index) but nothing came back. Thanks <ListBox Name="ListBox"> <ListBox.GroupStyle> <GroupStyle> <GroupStyle.ContainerStyle> <Style TargetType="{x:Type GroupItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupItem}"> <Border BorderBrush="CadetBlue" BorderThickness="1"> <Expander BorderThickness="0,0,0,1" Expanded="Expander_Expanded" Focusable="False" IsExpanded="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType= {x:Type ListBoxItem}}}" > <Expander.Header> <Grid> <StackPanel Height="30" Orientation="Horizontal"> <TextBlock Foreground="Navy" FontWeight="Bold" Text="{Binding Path=Name}" Margin="5,0,0,0" MinWidth="200" Padding="3" VerticalAlignment="Center" /> <TextBlock Foreground="Navy" FontWeight="Bold" Text=" Setups: " VerticalAlignment="Center" HorizontalAlignment="Right"/> <TextBlock Foreground="Navy" FontWeight="Bold" Text="{Binding Path=ItemCount}" VerticalAlignment="Center" HorizontalAlignment="Right" /> </StackPanel> </Grid> </Expander.Header> <Expander.Content> <Grid Background="white" > <ItemsPresenter /> </Grid> </Expander.Content> <Expander.Style > <Style TargetType="{x:Type Expander}"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientStop Color="WhiteSmoke" Offset="0.0" /> <GradientStop Color="Orange" Offset="1.0" /> </LinearGradientBrush> </Setter.Value> </Setter> </Trigger> <Trigger Property="IsMouseOver" Value="false" <Setter Property="Background"> <Setter.Value>

    Read the article

  • Query on MVVM design pattern on WPF.

    - by Ashish Ashu
    I am using MVVM architecture. I have a usercontrol UC as a View Model is a ModelData class ViewModel (UCViewModel) is binded to a usercontrol. I have three more usercontrols that is inside the usercontrol UC ( discussed above). Let's say uc1, uc2 and uc3. and the visibility of uc1 , uc2 and uc3 inside UC depends on the type selected ( which ever radio button is selected ). Since UC is binded to UCViewModel and I have to do all the stuff related to uc1 , uc2 and uc3 inside UCViewModel. Can I have seperate VM to uc1 , uc2 and uc3.. if Yes how can i do that ? Please Help!!

    Read the article

  • WPF combobox loses Aero theme when using a style trigger

    - by Greg R
    I am using style triggers to change combo box to texbox if it's readonly, but for some reason when I apply the style, it cause the combobox theme to change from Aero to Windows Classic (the theme I currently have in use on my PC). Can I avoid this somehow? Here is my code: <ComboBox ItemsSource="{Binding Source={StaticResource AllCountries}}" SelectedValue="{Binding OrderInfoVm.BillingCountry}" DisplayMemberPath="Value" SelectedValuePath="Key" IsReadOnly="{Binding ReadOnlyMode}" Style="{StaticResource EditableDropDown}" /> <Style x:Key="EditableDropDown" TargetType="ComboBox"> <Style.Triggers> <Trigger Property="IsReadOnly" Value="True"> <Setter Property="SelectedValuePath" Value="Content" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ComboBox"> <TextBox Text="{TemplateBinding SelectedValue, Converter={StaticResource StringCaseConverter}}" BorderThickness="0" Background="Transparent" FontSize="{TemplateBinding FontSize}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" FontFamily="{TemplateBinding FontFamily}" Width="{TemplateBinding Width}" TextWrapping="Wrap"/> </ControlTemplate> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style>

    Read the article

  • WPF ComboBox Binding to non string object

    - by Mike L
    I'm using MVVM (MVVM Light Toolkit) and have a property on the view model which exposes a list of objects. The objects contain two properties, both strings, which correlate to an abbreviation and a description. I want the ComboBox to expose the pairing as "abbreviation - description". If I use a data template, it does this easily. I have another property on the view model which represents the object that should display as selected -- the chosen item in the ComboBox. I'm binding the ItemsSource to the list, as it represents the universe of available selections, and am trying to bind the SelectedItem to this object. I'm killing myself trying to figure out why I can't get it to work, and feeling more like a fraud by the hour. In trying to learn why this works, I created the same approach with just a list of strings, and a selected string. This works perfectly. So, it clearly has something to do with the typing... perhaps something in choosing equality? Or perhaps it has to do with the data template? Here is the XAML: <Window x:Class="MvvmLight1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="300" Width="300" DataContext="{Binding Main, Source={StaticResource Locator}}"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Skins/MainSkin.xaml" /> </ResourceDictionary.MergedDictionaries> <DataTemplate x:Key="DataTemplate1"> <StackPanel Orientation="Horizontal"> <TextBlock TextWrapping="Wrap" Text="{Binding CourtCode}"/> <TextBlock TextWrapping="Wrap" Text=" - "/> <TextBlock TextWrapping="Wrap" Text="{Binding CourtDescription}"/> </StackPanel> </DataTemplate> </ResourceDictionary> </Window.Resources> <Grid x:Name="LayoutRoot"> <ComboBox x:Name="cmbAbbrevDescriptions" Height="35" Margin="25,75,25,25" VerticalAlignment="Top" ItemsSource="{Binding Codes}" ItemTemplate="{DynamicResource DataTemplate1}" SelectedItem="{Binding selectedCode}" /> <ComboBox x:Name="cmbStrings" Height="35" Margin="25" VerticalAlignment="Top" ItemsSource="{Binding strs}" SelectedItem="{Binding selectedStr}"/> </Grid> </Window> And, if helpful, here is the ViewModel: using GalaSoft.MvvmLight; using MvvmLight1.Model; using System.Collections.Generic; namespace MvvmLight1.ViewModel { public class MainViewModel : ViewModelBase { public const string CodesPropertyName = "Codes"; private List<Court> _codes = null; public List<Court> Codes { get { return _codes; } set { if (_codes == value) { return; } var oldValue = _codes; _codes = value; // Update bindings and broadcast change using GalaSoft.Utility.Messenging RaisePropertyChanged(CodesPropertyName, oldValue, value, true); } } public const string selectedCodePropertyName = "selectedCode"; private Court _selectedCode = null; public Court selectedCode { get { return _selectedCode; } set { if (_selectedCode == value) { return; } var oldValue = _selectedCode; _selectedCode = value; // Update bindings and broadcast change using GalaSoft.Utility.Messenging RaisePropertyChanged(selectedCodePropertyName, oldValue, value, true); } } public const string strsPropertyName = "strs"; private List<string> _strs = null; public List<string> strs { get { return _strs; } set { if (_strs == value) { return; } var oldValue = _strs; _strs = value; // Update bindings and broadcast change using GalaSoft.Utility.Messenging RaisePropertyChanged(strsPropertyName, oldValue, value, true); } } public const string selectedStrPropertyName = "selectedStr"; private string _selectedStr = ""; public string selectedStr { get { return _selectedStr; } set { if (_selectedStr == value) { return; } var oldValue = _selectedStr; _selectedStr = value; // Update bindings and broadcast change using GalaSoft.Utility.Messenging RaisePropertyChanged(selectedStrPropertyName, oldValue, value, true); } } /// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel() { Codes = new List<Court>(); Court code1 = new Court(); code1.CourtCode = "ABC"; code1.CourtDescription = "A Court"; Court code2 = new Court(); code2.CourtCode = "DEF"; code2.CourtDescription = "Second Court"; Codes.Add(code1); Codes.Add(code2); Court code3 = new Court(); code3.CourtCode = "DEF"; code3.CourtDescription = "Second Court"; selectedCode = code3; selectedStr = "Hello"; strs = new List<string>(); strs.Add("Goodbye"); strs.Add("Hello"); strs.Add("Ciao"); } } } And here is the ridiculously trivial class that is being exposed: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MvvmLight1.Model { public class Court { public string CourtCode { get; set; } public string CourtDescription { get; set; } } } Thanks!

    Read the article

  • WPF: ContentPresenter changing Foreground unexpectedly depending on where styles are located

    - by VLTII
    Hi, I'm having an issue with the ContentPresenter behaving unexpectedly based on whether the styles are located in the Window.Resources or in a ResourceDictionary. Specifically, I'm setting the Foreground of the default TextBlock to Black, then setting the Foreground value in my default button style to White. If the styles exits on the page like this, they work fine: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" x:Class="TestBed.MainWindow" x:Name="Window" Title="MainWindow" Width="640" Height="480"> <Window.Resources> <Style TargetType="{x:Type TextBlock}"> <Setter Property="Foreground" Value="Black" /> </Style> <Style x:Key="ButtonFocusVisual"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate> <Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/> </ControlTemplate> </Setter.Value> </Setter> </Style> <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="#F3F3F3" Offset="0"/> <GradientStop Color="#EBEBEB" Offset="0.5"/> <GradientStop Color="#DDDDDD" Offset="0.5"/> <GradientStop Color="#CDCDCD" Offset="1"/> </LinearGradientBrush> <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/> <Style TargetType="{x:Type Button}"> <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/> <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/> <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="Foreground" Value="White"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="Padding" Value="1"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" RenderDefaulted="{TemplateBinding IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}"> <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/> </Microsoft_Windows_Themes:ButtonChrome> <ControlTemplate.Triggers> <Trigger Property="IsKeyboardFocused" Value="true"> <Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/> </Trigger> <Trigger Property="ToggleButton.IsChecked" Value="true"> <Setter Property="RenderPressed" TargetName="Chrome" Value="true"/> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="#ADADAD"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </Window.Resources> <StackPanel x:Name="LayoutRoot"> <Button Content="Button" /> </StackPanel> </Window> But if I move those same styles over to a ResourceDictionary, the Foreground of the button switches to black. Updated MainWindow: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" x:Class="TestBed.MainWindow" x:Name="Window" Title="MainWindow" Width="640" Height="480"> <StackPanel x:Name="LayoutRoot"> <Button Content="Button" /> </StackPanel> </Window> ResourceDictionary: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> <Style TargetType="{x:Type TextBlock}"> <Setter Property="Foreground" Value="Black" /> </Style> <Style x:Key="ButtonFocusVisual"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate> <Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/> </ControlTemplate> </Setter.Value> </Setter> </Style> <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="#F3F3F3" Offset="0"/> <GradientStop Color="#EBEBEB" Offset="0.5"/> <GradientStop Color="#DDDDDD" Offset="0.5"/> <GradientStop Color="#CDCDCD" Offset="1"/> </LinearGradientBrush> <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/> <Style TargetType="{x:Type Button}"> <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/> <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/> <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="Foreground" Value="White"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="Padding" Value="1"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" RenderDefaulted="{TemplateBinding IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}"> <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/> </Microsoft_Windows_Themes:ButtonChrome> <ControlTemplate.Triggers> <Trigger Property="IsKeyboardFocused" Value="true"> <Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/> </Trigger> <Trigger Property="ToggleButton.IsChecked" Value="true"> <Setter Property="RenderPressed" TargetName="Chrome" Value="true"/> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="#ADADAD"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary> And my App.xaml because someone will ask for it: <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="TestBed.App" StartupUri="MainWindow.xaml"> <Application.Resources> <!-- Resources scoped at the Application level should be defined here. --> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="ResourceDictionary.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application> Any help would be greatly appreciated :)

    Read the article

  • WPF: How do I debug binding errors?

    - by Jonathan Allen
    I'm getting this in my output Window: System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'ListBoxItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment') This is my XAML, which when run looks correct <GroupBox Header="Grant/Deny Report"> <ListBox ItemsSource="{Binding Converter={StaticResource MethodBinder}, ConverterParameter=GrantDeny, Mode=OneWay}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Label Content="{Binding Entity}"/> <Label Content="{Binding HasPermission}"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </GroupBox>

    Read the article

  • multy threading wpf

    - by Eran
    Hey, I'm using web refernce call in new working thread in my application as follow: Thread callRunner = new Thread(delegate() { _mediator.IncomingCallDetails(phoneNumber); }); callRunner.Start() ; the _mediator calls the web refernce and replay to the caller in event as follow: void IncomingCallComplited(IncomingCallEventArg args) { Caller = args.Caller; Lodgers = args.Lodgers; PreviousMissions = args.PreviousMissions; } Caller ,Lodgers and PreviousMissions are properties of an object that bind to GUI element,as for now the binding works fine and i can see the values from the web refernce in screen my question is should I use Dispatcher in the event or in any other phase ? and if I do can someone please explain why? Thanks Eran

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >