binding

binding a combobox to different DataContext

Hello, The combobox items are taken from one table, one field on which binding is made. After I saved in the database the selected item in another table, I want that the selected item to be the one which was saved. But the selected item is lost. So, my question is: can I bind the combobox to two DataContexts or maybe another solution ?....

can I have a WCF binding that goes through SSL (using https) with transport security set to none?

Greets. I realize this might be seen as a duplicate question as this but I'm getting a different error. My IIS is setup to use SSL. My service is setup relatively simple. Just a simple log in service. When I try to navigate directly to the svc file on the host machine I get this error Service cannot be activated due to an exception du...

How to dynamically register to jquery custom events?

Hello all, I have built a dom object Engine that has private/public fields/methods that I have simplified below: function Engine(args){ this.display = args.display; this.getDisplay = function(){return this.display;} this.alertMsg = function(msg){ console.log(this.display); alert(msg); } } What I would like to...

How to dynamically change ConverterParameter (or any) property of a MultiBinding (or any other) resource at runtime?

Hi. i'm new to wpf and xaml. i find solutions of most of the problems (in other languages) by searching here n there or googling around but this one made me crazy. i searched a lot on google and browsed many forums, but it seems that this time i met with a real challenge! I have following code in Window.Resources: <my:NameConverter x:K...

Why does my TileList selectedIndex not get updated?

In the code below, the presentedAlbumIndex is used to control the selectedIndex of the TileList. Item "five" is initially selected. Whenever the button is pressed the first item in the array is deleted, and the presentedAlbumIndex is decremented. In theory, the selected index should stay with "five" every time the button is clicked (u...

Binding via <% on .aspx page

Is there any difference between performing binding on .aspx page via <%# some code %> and <%= some code %>? Example: <%# ResolveUrl("~/default.aspx") %> VS <%= ResolveUrl("~/default.aspx") %> Thanks. -Igor ...

How to prevent "fat finger syndrome" in absence of req. predeclearation?

For example: on rising edge (reset): sync = defaultValue; ... ... various processing constructs ... ... if (event == someEvent) // Back at the Batcave // The vilianous Fat finger Syndrome // strikes again! synch = someEventProcessing() ... ... various processing constructs ... ... someSyncProcessing(sync) // Foiled again!...

WPF ListView Binding with UpdateSourceTrigger set to explicit strange behaviour

Hi, I have a listview with different the datatemplates set up to bind. I want to update some of the columns (mix of textblock and progress bar) when I call UpdateSource() on a bindingexpression. I also want to update 1 of the columns when the property is changed which it is bound too. I was able to get the PropertyChanged behaviour to ...

WPF Standard Commands - Where's Exit?

I'm creating a standard menu in my WPF application. I know that I can create custom commands, but I know there are also a bunch of standard commands to bind to. For example, to open a file I should bind to ApplicationCommands.Open, to close a file I should bind to ApplicationCommands.Close. There's also a large number of EditCommands, ...

When defining a binding purely in XAML, can the source variable be accessed in the code behind?

I'm learning binding in WPF. I can get binding to work when 1) the text of one control goes directly to the text field of another and 2) when I manually configure binding in the code-behind file. In the first scenario, I use purely XAML to configure the binding. Is it possible to access the source variable from XAML in the code-behi...

WPF RelativeSource binding question

HI! I have an Expander and a TextBox. I want to disable the TextBox when the Expander is expanded and enable when it's not expanded. How to do that? I've tried something like this: <TextBox IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Expander}, AncestorLevel=1},Path=IsExpanded}" /> But it's vi...

Bind TextBox to large string in WPF using MVVM

I am having a performance problem binding a large string to a a TextBox in WPF. In the view I am binding a TextBox's Text property to the view model's Output property which is a StringBuilder. View: <TextBox Text="{Binding Output, Mode=OneWay}" IsReadOnly="True"/> ViewModel: public StringBuilder Output { get { retur...

WPF -- Anyone know why I can't get this binding to reference?

<StackPanel x:Name="stkWaitingPatients" Width="300" Margin="0,0,0,-3" DataContext="{Binding Mode=OneWay, Source={StaticResource local:oPatients}}"> I'm getting StaticResource reference 'local:oPatients' was not found. Here is the codebehind: public partial class MainWindow : Window { ListBox _activeListBox; clsPatients...

C#/WPF: Get Binding Path of an Element in a DataTemplate

Hello, How can I get the Binding Path of an Element in a DataTemplate? My XAML looks like this: <GridViewColumn Header="Double"> <GridViewColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding TotalValues, Mode=OneWay, StringFormat=\{0:0\'0.00\}, Converter={StaticResource...

How to read object type hosted by bindingSource

EDIT: I changed wording, added long sample code to be more descriptive I need to read type name of object bind via BindingSource. My method accepts BindingSource as parameter and it doesnt know about object type 'hosted' by BindingSource. But I need to read that object type To explain better what I meant, assume I have 2 classes clas...

How to create a data template dependent on an XML Attribute?

I'm working on a WPF interface that reads an XML file and displays the data. The XML file would be something like this: <People> <Person Gender="Male"> <Name>Joe</Name> </Person> <Person Gender="Female"> <Name>Susan</Name> </Person> </People> I need a data template dependent on the Gender attribute of ...

Collapsible 'list' of bound elements in WPF

I have what I thought was a simple requirement, but I'm having difficulty working out how to do it. I'm binding to an address (Line1, Line2, Line3, Line4 for example) What I want to do is display Line1 Line2 Line3 Line4 But if any line is empty or null, I'd like to 'collapse': Line1 Line3 Line4 I've tried a StackPanel with TextBl...

WPF, XAML: How to style a ListBoxItem using binding on property of ListBox ItemsSource object?

I have a ListBox which is bound to ObservableCollection of LogMessages. public ObservableCollection<LogMessage> LogMessages { get; set; } public LogMessageData() { this.LogMessages = new ObservableCollection<LogMessage>(); } Each Message has two parameters: public class LogMessage { public string Msg {...

WPF - ComboBox binding issue

Hi, I'm using WPF/MVVM and am having a binding issue with a ComboBox - any help appreciated! Heres my Combo ... <ComboBox Name="ComboBoxAvailableCriteria" Width="255" ItemsSource="{Binding AvailableCriteria}" DisplayMemberPath="SearchableAttribute.Name" /> And heres my ViewModel ... private List<SearchCriteria> _availableCriter...

wpf usercontrol, bind command parameter of button to the parent usercontrol

Hi, I've got a WPF UserControl which contains a remove button, I'd like to pass the entire UserControl as the CommandParameter. Currently the binding is set to CommandParameter="{Binding RelativeSource={RelativeSource Self}}" which gives me the button, but how can I get the entire control? Can anyone assist please? Cheers, Andy <Us...