xaml

Move the listbox items instead of the "selector bar"

1-Is it possible to move the listbox items instead of the "selector bar". In that way, the selector bar has a static position but the items will move. what Im trying to achieve is something like the scrollbar at the bottom of this image: http://i.afterdawn.com/storage/pictures/plex_netflix_addon_3.png 2-is Listbox with horizontal or...

getting selected checkbox items from listbox mvvm

Hi I have listbox in which I am dynamically showing the pre selected checkboxes from the database. Now I want to loop through it to get the selected items/values. I am using mvvm light wpf. kindly Suggest? Thanks ...

how can i open xaml file without clearing the visual root

I want to open a new xaml file while keeping the original root running. At the same time as I want to play a video and when use click something else I don't want to exit I want to keep running the video in the background, any ideas or solutions? ...

What are the various uses of Attached Properties?

I've seen some really varying uses of AttachedProperties so far in my adventures in WPF, and am wondering, what are some of the various uses? I've seen fairly mundane uses, such as those found in Grid and Canvas, as well as some really cool hacks allowing binding to collections without setters. What other applications have you found fo...

WPF share DataGrid column setup (template? style?)

I'll start out by saying that I'm trying to follow MVVM as strictly as I can, so I'd like to do the following using Binding only. I have multiple DataGrids showing different ObservableCollections of the same data type. How can I define once which columns, and their Binding paths, will show on all of the DataGrids? It doesn't appear tha...

Rotating states in a Blend 4 VisualStateManager based on timer events?

I'm building a Silverlight 4 UserControl in Blend which has three VisualStates. I would like to have the states change from the first to the second state after a delay of a few seconds, second to third after a few more seconds, third to first after another delay, and continue rotating like that. Essentially, this is a very primitive ...

Applying TextDecoration to an WPF ListViewItem

I can see how to apply a text decoration to a GridViewColumn. <GridViewColumn Header="Tool" > <GridViewColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Path=Entity.ToolId}" TextDecorations="{Binding Path=TextDecoration}" /> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> But if ...

Active code in XAML properties

I have a situation where I want UIElement to have a top margin of ((this.height / 2) - 70) Currently, the XAML property is Margin="0, 40, 0, 0" How can I combine the equation above into my XAML? I know this is probably simple, but I can't figure out what terms to search for. ...

Remove unused styles in a Silverlight application

I'd like to remove all the unused styls in order to shirnk the xap file, is there a tool for doing .xap size optimization? ...

How do you get Visual Studio to recognise XAML changes?

I have just started with WPF so am probably missing something simple here. I have a window that I am editing in VS 2010. When I change the XAML by hand and then run the application (F5) the window remains as before my edit, however if I do a rebuild and then run the application my changes show up. Is there any way to get VS to recognise...

Problem using OpacityMask (XAML)

Can someone explain this WPF behaviour? <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; <Grid> <!-- Rounded mask --> <Border Name="mask" VerticalAlignment="Top" Background="Black" CornerRadius="48" Height="400" Width="400" /> <S...

Dynamic Content in XAML Listbox with Observable Collection

This is a bit of a difficult problem to explain, but I'm hoping it has a reasonably simple resolution. I am writing a Listbox control in XAML and most of the layout for the ListBox.ItemTemplate laid out in a grid is the same throughout the list. However the listbox is a "Problem Resolver" that picks out anomalies in a list of customer o...

How to hide entire DataGrid in Silverlight?

Hello! I'm using DataGrid control and I need to hide it. I've tried to use dtgAllAccounts.Visibility = Visibility.Collapsed. But this doesn't work. Column headers still visible. Are there any ways to hide entire DataGrid with all column headers? <sdk:DataGrid AutoGenerateColumns="False" HorizontalAlignment="Cente...

Why Microsoft add Design-time Attributes (d:DataContext ...) and do not use the current DataContext instead

In WPF-XAML, determining DataContext at designtime vs runtime. Why do we have to add "d:DataContext" while we already have set the "DataContext" ? Why Microsoft introduced DesignTime attributes (code that we have to add, a little bit complex) when it could already be determined automatically by itself using "DataContext" attribute. The ...

WPF DataGrid - Hiding Column using a CheckBox

I am trying to control the visibility of a column using a checkbox (this is in WPF 4.0). Here is a snippet of my XAML: <Window.Resources> <BooleanToVisibilityConverter x:Key="BoolToVisConverter" /> </Window.Resources> <CheckBox x:Name="GeneralDetailsVisible" Content="General Details" Margin="5"/> <DataGridTextColumn Header="Crew...

Silverlight 4 - how can I make text box to have cursor active in it?

I have multiple text boxes on a silverlight page. How can I make one of them active so that I will not have to click it to be able to type into it. ...

TextBox control template with buttons

How to improve control template for custom numericupdown? <Style TargetType="{x:Type Controls:FloatTextBoxPicker}" BasedOn="{StaticResource {x:Type TextBox}}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Controls:FloatTextBoxPicker}"> <DockPanel LastChildFill="True"> ...

WPF pass data-generated parameter to Method through XAML

I am writing a "problem resolver" for a despatch app. The despatch app prints labels using a piece of software supplied by the UKs Royal Mail postal service. The software ensures that the addresses on the labels are "correct" as per the Royal mail's database of valid addresses, it renders a trackable code in alphanumeric and barcoded fo...

When to use XamlWriter.Save() to serialize domain object?

What's the rationale (if any) of using XamlWriter.Save() to serialize a domain object? Please describe realistic scenarios. Thanks. ...

Change Layout (Template) in runtime build controls

My scenario: I have in my form a tabControl. I've extended the TabItem control to some other classes that I want to add the TabControl. I need that each one of the ExtendedTabItem have a specific header and data template. Something in the line of: <DataTemplate DataType="ExtendedTabItem"> <StackPanel Height="100" Width="90"> ...