I've seen on the internet quite a few examples of binding a boolean to the Visibility property of a control in XAML. Most of the good examples use a BooleanToVisibiliy converter.
I'd like to just set the Visible property on the control to bind to a System.Windows.Visibility property in the code-behind, but it doesn't seem to want to wo...
I have a listview that is binded to a ThreadSafeObservableCollection. The background of each of these items is set to an enum that is run through a color converter, here's the code for these 2 settings.
<UserControl.Resources>
<EncoderView:EncoderStatusToColorConverter x:Key="ColorConverter"/>
<Style x:Key="ItemContStyle" Targe...
I have a ComboBox hosted in a ListView and I need changes in the CombBox to update the supporing class that the ListView is bound to.
Here is my DataTemplate
<DataTemplate x:Key="Category">
<ComboBox IsSynchronizedWithCurrentItem="False"
Style="{StaticResource DropDown}"
ItemsSource="{Binding Source={...
I've got an enum like this:
public enum MyLovelyEnum
{
FirstSelection,
TheOtherSelection,
YetAnotherOne
};
I got a property in my DataContext:
public MyLovelyEnum VeryLovelyEnum { get; set; }
And I got three RadioButtons in my WPF client.
<RadioButton Margin="3">First Selection</RadioButton>
<RadioButton Margin="3">The Other...
Hi, I have a combobox derrived class which has a SelectedLookupItem property. This returns a LookupItem object. LookupItem is a MustInherit class.
I have a class that has a property whose return type is ChildLookupItem (a class derrived from LookupItem). When I set up binding to link the combo to this property, I get a FormatException "...
I have a Enum for example...
public enum TypeIdentifier {
NotSet = 0,
Type1= 1,
Type2= 2,
Type3= 3,
Type4= 4,
Type5= 5
}
public class CommonObject
{
TypeIdentifier myTypeIdentifier {get; set;}
}
I have a WPF UserControl that has a generalized object binding.I have a c...
I want all buttons to perform an action before and after their normal onclick event. So I came up with the "brilliant" idea of looping through all those elements and creating a wrapper function.
This appeared to work pretty well when I tested it, but when I integrated it into our app, it fell apart. I traced it down to the 'this' valu...
I ran across this case of UnboundLocalError recently, which seems strange:
import pprint
def main():
if 'pprint' in globals(): print 'pprint is in globals()'
pprint.pprint('Spam')
from pprint import pprint
pprint('Eggs')
if __name__ == '__main__': main()
Which produces:
pprint is in globals()
Traceback (most recent ...
Good morning,
I am working with an object which has sub objects with in (see example below), I am attempting to bind a List to the datagrid. When I bind the List<>, in the cell that contains the subObject I see the following Value ... "namespace.subObject" ... the string values display correctly.
Ideally I would like to see the "Descri...
I'm binding a domain objects property to the Text property of a System.Windows.Forms.Label using the DataBindings.
Label l = new Label();
l.DataBindings.Add(new Binding("Text",myDomainObject,"MyProperty"));
However, when I change the domain object, the Label does not reflect the change. I know that for complex Controls like the DataGr...
I've got two WPF Toolkit DataGrids, I'd like so that when the user resizes the first column in the first grid, it resizes the first column in the second grid. I've tried binding the width of the DataGridColumn in the second grid to the appropriate column in the first grid, but it doesn't work. I'd prefer to use all xaml, but I'm find wit...
Hi Guys. I'm trying to make some kind of shape in wpf, which does resize itself to the content (which should be text). Unfortunately, the stretch property isn't the right thing, since I want only the width of the Shape resized and without the borders (pls copy bottom example in xamlpad to see for yourself) of this shape stretched. The bo...
I'd like to bind to a value reachable only with XPath from the property of an element.
The element is a ComboBox populated from some XML, and its property is SelectedItem. SelectedItem points to an XML element, and I'd like to bind to a child element's value within that, which can be reached with an XPath.
The XAML looks like this, so ...
Hi,
My wcf service's web.config looks like this:
How can I confirm that it is using the settings correctly?
I still get this timeout error sometimes even though I have configured the binding to use:
SendTimeout = 10 minutes etc. ?
<system.serviceModel>
<services>
<service behaviorConfiguration="MyService.MyServiceBehavior"...
I am binding an Image.Source property to the result of the property shown below.
public BitmapSource MyImageSource
{
get
{
BitmapSource source = null;
PngBitmapDecoder decoder;
using (var stream = new FileStream(@"C:\Temp\logo.png", FileMode.Open, FileAccess.Read, FileShare.Read))
{
decoder = new PngBitmapDecod...
I have a WPF sub window with some input controls that the user has to correctly fill before pressing Ok button.
I have already implemented the interface IDataErrorInfo to validate all properties bound to UI Controls.
Now I would like that the IsEnabled property of Ok button is True only if ALL controls are valid, otherwise it has to be...
I'm working with a WPF dialog window that contains a ListBox. The list box can display both an 'icon' and 'list' view. To accomplish this, we used ListBoxItem styles that are dynamically applied to the ListBox, as well as a pair of corresponding ItemsPanelTemplates. As is, it displays beautifully. However, when loading this dialog we ge...
Or, to be more clear, how can I format a block of text (in my case, to be included within a tooltip) such that some portions of the text come from bound values.
In plain C# I would use:
_toolTip.Text = string.Format("{1:#0}% up, {2:#0}% down",
Environment.NewLine, percentageOne, percentage2);
However the WPF XAML markup for a Tex...
In many places, like in app.config/web.config files I have to specify types using this verbose fully qualified names, like
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
This MSDN site says, that
Partial binding, which speci...
I have a web application running on port :80, and I have an Axis web service that is part of that web application. As such, the service is running on port :80 as well.
However, for security reasons our client has asked us to change the web service port to 8080 so that they can allow access only to that port for remote consumers of the w...