I've got a TreeView to which I associate a ContextMenu. That contextmenu has an item whose IsChecked property I want to bind to my ViewModel. Since I am using a tree each treeitem is bound to a subproperty of my ViewModel.
In the VS2010 output window I am seeing this databinding error:
BindingExpression path error: 'IsAutoStart' proper...
In the example below:
I start program, type text, click button, see text above. Press ENTER see text again.
BUT:
I start program, type text, press ENTER, see no text.
It seems that the KeyDown event doesn't get access to the current value of the bound variable, as if it is always "one behind".
What do I have to change so that wh...
I have a database table that records what publications a user is allowed to access. The table is very simple - it simply stores user ID/publication ID pairs:
CREATE TABLE UserPublication (UserId INTEGER, PublicationID INTEGER)
The presence of a record for a given user & publication means that the user has access; absence of a record i...
I'm using MVVM and am trying to databind the Source property of Image to my ViewModel in such a way that I can change the icon on the fly. What is the best pattern to follow for this? I still have the flexibility to change my ViewModel to suit, but I don't know where to start in either the xaml or ViewModel.
To be clear, I don't want my...
My generic question is as the title states, is it best to load data during ViewModel construction or afterward through some Loaded event handling?
I'm guessing the answer is after construction via some Loaded event handling, but I'm wondering how that is most cleanly coordinated between ViewModel and View?
Here's more details about my ...
I have a enum let's say
enum MyEnum
{
FirstImage,
SecondImage,
ThirdImage,
FourthImage
};
I have binded this Enum to my combobox in XAML.
While defining an combobox I have defined an ItemTemplate of combox to take Two UI element:
TextBlock that show the enum value (Description)
Image
I have done this much in XAML.
I am...
In my Silverlight 3 project, I'm using a ListBox to display results of a Get() operation form a WCF WebService.
The ListBox's item template is the following :
<ListBox x:Name="m_listview" ItemsSource="{Binding Users, Mode=TwoWay, UpdateSourceTrigger=Default}" Foreground="{StaticResource EnergyBlue}" Background="{StaticResource EnergyBa...
Hi,
I have the following problem: the application is using the custom itemscontrol called ToolBox. The elements of a toolbox are called toolboxitems and are custom contentcontrol. Now, the toolbox stores a number of images that are retrieved from a database and displayed. For that I use a datatemplate inside the toolbox control. However,...
I have my little designer tool (my program).
On the left side I have TreeView and on the right site I have Accordion.
When I select a node I want to dynamically build Accordion Items based on Properties from DataContext of selected node.
Selecting nodes works fine, and when I use this sample code for testing it works also.
XAML code...
I have a collection that contains all the items that I want to keep track of. I want to display 3 different grids, and in each one I want to display a different filtered version of the items. Is there a way to bind to a filtered version of the main collection without having to maintain 3 separate collections to bind to?
...
I have a Canvas in Silverlight with two ellipses on it. The ellipses are animated via events in the code behind. I have added a line two the canvas and I would like each end of the line to be bound to the center of each ellipse. Is it possible to do this in XAML databinding or will I have to manually move the end of the line around in...
Hi, i have little dilemma, i often use data-bound controls such as Gridview in conjunction with ObjectDataSource. But i have two possible options when can i bind data to Gridview. The first is that i set datasourceid of gridview in aspx file and databind occurs in a moment before PreRender event occurs or i can set datasource in Page_Loa...
Ok, I didn't want a bunch of ICommands in my MVVM ViewModels so I decided to create a MarkupExtension for WPF that you feed it a string(the name of the method), and it gives you back an ICommand that executes the method.
here's a snippet:
public class MethodCall : MarkupExtension
{
public MethodCall(string methodName)
{
Method...
I've just started to work with FxCop to see how poorly my code does against its full set of rules. I'm starting off with the "Breaking" rules, and the first one I came across was CA2227, which basically says that you should make a collection property's setter readonly, so that you can't accidentally change the collection data.
Since I'...
I'm trying to animate a RadialGradientBrush in my application. I get the super helpful exception:
Additional information: 'System.Windows.Style' value cannot be assigned to property 'Style' of object 'System.Windows.Controls.Border'. '[Unknown]' property does not point to a DependencyObject in path '(0).(1).[0].(2)'. Error at object 'S...
I'm wondering how exactly the XAML sample (MSDN sample) works:
<Style x:Key="textBoxInError" TargetType="{x:Type TextBox}">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip"
Value="{Binding RelativeSource={x:Static RelativeSource.Self},
Path=(Validation.Er...
I'm not sure if I'm misunderstanding the binding in Flex. I'm using Cairngorm framework. I have the following component with code like:
[Bindable]
var _model:LalModelLocator = LalModelLocator.getInstance();
....
<s:DataGroup dataProvider="{_model.friendsSearchResults}"
includeIn="find"
...
Using Silverlight 4, I'm trying to initialize a converter in the Resources section of my UserControl with a reference to one of the objects in my control. When I try to run the application I get this exception, note Line 16 in the actual XAML file is the converter:PointConverter.... line:
System.Windows.Markup.XamlParseException: 2260 A...
I'm using Flex with Cairngorm framework.
I have a custom component which I create like this:
<components:FriendSearchPaginator id="searchResultsPaginator"
paginationElement="{_model.findFriendsPaginationElement}"
visible="{_model.friendsSearchResultsPaginat...
I am using the following markup in WPF:
<StackPanel.Triggers>
<EventTrigger RoutedEvent="RadioButton.Checked" SourceName="xmlRadioButton">
<EventTrigger.Actions>
<BeginStoryboard Storyboard="{StaticResource ShowXmlPanel}"/>
</EventTrigger.Actions>
</EventTrigger>
<Event...