xaml

Binding evaluation after UI is visible.

Hi All, Here is my scenario. I have usercontrol, uc1. In uc1 i have listbox on which ItemTemplateSelector is defined and it is pointing to different DataTemplates having other usercontrols eg. uc2, uc3 etc... Items in listbox are getting updated when UI is visible. I mean, I can see for eg. in a list box item first arrow comes up, th...

How to set DataContext for a single element?

The beginner tutorial I've followed said I should create a namespace on the window, <Window ... xmlns:vm="clr-namespace:MyApp.ViewModels" /> And then set the DataContext like this, <Window.DataContext> <vm:MyViewModel /> </Window.DataContext> But I don't want the DataContext to apply to the whole window. I want different elemen...

StackOverflowException on InitializeComponent

I'm trying to follow this little tutorial, but I keep getting this exception. The relevant XAML looks like this: <StatusBar Margin="0,288,0,0" Name="statusBar" Height="23" VerticalAlignment="Bottom"> <StatusBar.DataContext> <m:MainWindow /> </StatusBar.DataContext> <TextBlock Name="statusText" Te...

How to disable accelerator key for some buttons

I am setting the .Content value of a Button to a string that contains underscores; the first underscore is being interpreted as an accelerator key. Without changing the underlying string (by replacing all _ with __), is there a way to disable the accelerator for non-menu Buttons? ...

How set property background "Transparent" in listbox

I have ListBox and i need set background "Transparent". I've selected in red, then that should be transparent: style ListBox, ListBoxItem, ScrollViewer and ScrollBar: <Style TargetType="{x:Type ScrollBar}"> <Setter Property="Stylus.IsFlicksEnabled" Value="false"/> <Setter Property="Foreground" Value="{DynamicResource {x:Sta...

VS2010 Workflow Design Surface Inoperative

I am using VS2010 and having an issue where upon opening my solution the Workflow.xamlx does not appear to render correctly. The activities on the design surface only get drawn for the area that is initially visible when the xamlx loads. To demonstrate the problem, I see the following. (I apologize for the blur) The first problem is...

Tip screen at startup that can be disabled.

I am planning on creating a tip page that pops up with directions on how to use the app, and can be turned off with a checkbox. I imagine that in order to save the state of the checkbox's selection, I need top store it as a boolean somewhere on the system. Would this be done in something like a txt file stored locally using IsolatedSto...

Powershell pack uri object

I'm trying to create a pack ui referencing a xaml resource inside of an assembly file in powershell. After reading this post I tried to do this: $resource = new-object system.uri("pack://application:,,,/WPFResource;component/test.xaml") The I get an error noting that it is expecting a port since there are two colons. Can anyone pleas...

Is there a standalone visual editor for WPF xaml files?

Is there a stand-alone visual (WYSIWYG) editor for WPF xaml files like the Visual Studio 2010 designer? The VS2010 one crashes all the time and is very slow (there are lots of threads on XAML slowness in VS, but all the recommendations seem to point to editing the XML files with a text-based editor). I want a visual one as I'm very new ...

How to localize WPF without recompilation? (dynamically loaded XAML)

We have a WPF application that is loading a usercontrol at runtime from the deployed .XAML file (customer requirement - they want to be able to replace the views entirely). We would like to localize strings in this XAML file. All .resx file based WPF localization approaches I have found on the web seem to require recompilation when the...

Unable to find WPF User Controls in Visual Studio C# 2008; stuck with nonexistant Control instead.

Hi guys, This is a rather unusual question but here's the issue: I have a WPF control created in Visual Studio C# 2008, map.xaml, created in the project Remote. I want to add this to a Windows Form, also in Remote, using the ElementHost tool. Simple, right? I created the ElementHost, went to select the HostedContent, but the only cho...

Trying to make a XAML created storyboard be called in C# code behind

I have a storyboard here in XAML using Microsoft expression Blend and I am wanting to call this storyboard in C# and I have researched for a day or so and I cannot seem to find the answer. I am at this point <UserControl.Resources> <Storyboard x:Key="LoginClose"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UI...

DataGrid row content vertical alignment

Hi, I have a regular DataGrid from WPF 4.0 RTM, where I put data from database. In order to make clean & light style of DataGrid I use a tall/high rows and by default DataGrid aligns row content in top vertical position, but I want to set a center vertical alignment. I already tried to use this property VerticalAlignment="Center" i...

How to catch Click on ListboxItem when the item is templated?

I have a ListBox with ItemsTemplate set. Now I want to catch Ctrl + Left click on a ListBoxItem. I found KeyBoard class that should give me modifier keys. Now how do I get the click event on the ListBoxItem? Even better, how do I bind it to ICommand. I found some bits and pieces but don't know how to connect them. It seems InputBindin...

Combobox Text displays different than in the Dropdown.

I want to have a combobox with dropdown list of codes and definitions, but only display the definition of the selected item in the textbox part. For example, Y-Yes and N-No in the dropdown, and when Y is selected, only display Yes in the textbox. ...

WPF - Prevent Autoresize of ListBox on new Databinding?

Hey all, I currently have a window with a listbox within in. The listbox shows the results from a search. The problem I currently have is that when a search is performed and enough items are added to the listbox, the listbox expands vertically and forces the form to expand vertically as well. I know I can fix this with a maxheight, b...

WP7 Frame embedded in a page linking to another page

I have a xaml page that I want to host another xaml page for various reasons. I attempted to use the Frame control, but I ended up with a warning telling me that the default constructor must be public... <controls:PivotItem Header="page1"> <Controls:Frame Source="MyPage.xaml"/> </controls:PivotItem> Okay, well that doesn't work;...

XAML To MXML Conversion

Is to possible to generate MXML file using XAML file and vice versa??? Both are based on xml and contains similar type of coding.... So is there a way to convert XAML file to MXML file and vice versa? Thanks in advance... ...

How to arrange the elements?

I need to place objects 40% 40% 20% and that there were no scroll <Grid Grid.Row="1"> <Grid.RowDefinitions> <RowDefinition Height="40*" /> <RowDefinition Height="40*" /> <RowDefinition Height="20*"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> <ColumnDef...

What generated this database accessor code?

I'm trying to make alterations to an existing project, and I've found a project in the solution which is full of generated classes. Problem is, nobody here can tell me what generated them, so I'm pretty much left with pasting one of the classes in here and hoping someone will be able to tell me where they came from. The solution I'm w...