I'm trying to programmatically add events and elements to a DataTemplate in a Silverlight 3.0 app. I have a User Control with a dependency property where I would like to take the template that's set, tweak it, and then set the modified version to an inner control.
The idea I have is to take the DataTemplate that comes in, read its XAML,...
I'm creating a lookless control based on Selector in WPF with a Dependency Property named "ListItems". When SelectedItems is changed, I do:
// CollectionViewSource ListItems = ...
ListItems.Source = newSelectedItems;
ListItems.Refresh();
And In my control template I bind it to a listbox like this:
<ListBox ItemsSource="{TemplateBindi...
I am using RibbonControlLibrary by Microsoft. It has three predefined themes and one can use them by
<ResourceDictionary Source="/RibbonControlsLibrary;component/Themes/Office2007Black.xaml"/>
or
<ResourceDictionary Source="/RibbonControlsLibrary;component/Themes/Office2007Blue.xaml"/>
or
<ResourceDictionary Source="/RibbonControlsLibra...
Hello there,
i'm building a Videoplayer custom control (Project called WpfCustomControlLibrary1) and want to add a Load Command.
This is what i have added in my class to get this Command:
Public Class VideoPlayer
Inherits Control
...
Public Shared ReadOnly LoadCommad As RoutedUICommand
....
Shared Sub New()
'This OverrideMetadata...
Somewhere I read that ExpressionBlend can create copies of the default style of a wpf control for the developer to edit.
However, VisualStudio can not. (At least I haven't found a way...)
Is it possible to access/view the default styles (and templates) of wpf controls.
A Gui would be nice, but a (web)-resource to view the styles would ...
It would be nice to have a tool in which you could copy and paste chunks of XAML such as this:
<StackPanel Margin="10">
<TextBlock Text="Title"/>
</StackPanel>
And the tool would output the equivalent code behind such as this:
StackPanel sp = new StackPanel();
sp.Margin = new Thickness(10);
TextBlock tb = new TextBlock();
tb.Tex...
I currently have a Combobox like the following:
//XAML
<ComboBox>
<ComboBoxItem> Awake & Alive</ComboBoxItem>
</ComboBox>
This raises an error:
Entity references or sequences beginning with an ampersand '&' must be terminated with a semicolon ';'.
I assume I am missing an escape sequence of some sort to allow me to use a &. How ca...
I've got a basic spinner type control I've whipped up, and it works reasonably well, but there's a massive amount of repeated code throughout it. It's essentially the same element over and over again except for two properties, and one of those properties is the BeginTime for the Storyboard - each line just endlessly repeats its animati...
I have used the ViewBox Silverlight Toolkit control to bind to, however Silverlight 4 add this to the Core, however it no longer has a specific "Content" property to bind to - how to I bind Content to the new ViewBox?
For example I want to be able to do this (not valid syntax):
<ViewBox Content="{Binding Path=Canvas}"/>
Where the C...
I have the following XML (simplified example) which should have a parent/child relationship between two ComboBox's. The parent binds correctly but the child does not bind to the parents SelectedItem.
When I set xmlns against the foobar XML and remove all namespace references it works as expected. Also if I set ItemsSource="{Binding XPat...
Hello, Im programming a little Twitter Client just for fun. I have the tweet's text on a textblock and I want to make the URLs clickable.
I know that I have to parse the URLs with a regexp but... how I put text plus link on the textblock?
I can't have a string like: Hello check my blog at <Hyperlink>http://myblogurl.com</Hyperlink> be...
I am trying to get a treeview to bind my collection so that all groups show nested groups and each group will show entry.
How can I use the HierarchicalDataTemplate so that treeview will process both SubGroups and Entries collection?
Groups show subgroups and entries
Example:
Group1
--Entry
--Entry
Group2
--Group4
----Group1
------Ent...
I am writing an app in WPF. It is getting tiresome making all my converters for simple stuff.
I looked around and found WPFix. It seems nice, but has not had any releases in almost a year and is looking abandoned.
Has anyone used this? Is it stable? Does anyone have any recommendations for a different solution to allow Lambdas in...
I have a component which call 2usercontrols.
Usercontrols1 :(code part)
<StackPanel Name="NeedThisName" >
</StackPanel>
Usercontrols2 :(code part)
<Button >
<Button.Template>
<ControlTemplate>
<Rectangle >
<Rectangle.Fill>
<VisualBrush Visual="{Binding Elemen...
How can I define a common Style for the TextBox and the PasswordBox?
My approach, I have define a Style for the TargetType FrameworkElement but this doesnt work as common style, then few propertys doesnt exist on the FrameworkElement.
My TextBox Style is equals the PasswordBoxStyle
<Style TargetType="{x:Type TextBox}">
<Setter Pro...
Hello all
I want to be able to have a generic style template that can switch colors of my textboxes based on a bool. But I don't want to have to create a unique style for each textbox. How do I do this?
I have put some sample code below how I might expect this to work.
Three textboxes, all with different bindings but attempting to use...
I have a style template (below) that does not update when my Tag binding updates. The data itself updates and I receive no binding errors so expect everything is bound correctly it is just that the style doesn't seem to update at all. I have notifypropertychanged events in all the right places afaik so doubt this is the issue.
Thanks
...
I have a couple of views that I display as overlays on the main window by binding the visibility to a boolean property in my ViewModel.
The main window looks something like this:
<Grid>
<vw:MainContentView/>
<!-- Overlays (normally invisible) -->
<vw:NotificationsView/>
</Grid>
...
I need a control to call DragMove() for a Window on MouseLeftButton down, but still function when clicked.
If DragMove() is called, Click and MouseLeftButtonUp are not ever fired because DragMove() is a blocking call until they release the mouse button.
Does anyone know a workaround to make this work?
I have tried this hack based on T...
What is the best way to get back the XAML/XML value of a FlowDocument?
I noticed there isn't a .Value, .Text, .Caption, .ToXml(), etc...
UDPATE:
I'd like to be able to get access to it initially to serialize to disk or database. Treat it as its own document format. Later translating it to other formats would be nice.
Also been wonder...