Alright, so, here is the scenario:
I am outputting the result of a console app (in my case, MSBuild) and it has colors. I want to use those colors, or at least some colors, in a RichTextBox on my WPF page. I successfully have it routing the output to the RTB and it works great by adding new inlines. It's fast and efficient.
The problem...
What's the best way to use WPF's built-in RoutedCommands with Caliburn?
For example, in my shell I have an Edit menu with a Copy item in it attached to the standard command found in ApplicationCommands:
<Menu>
<MenuItem Header="Edit">
<MenuItem Header="Copy"
Command="ApplicationCommands.Copy" />
</Menu...
I'm having trouble figuring out a way to unit test a WPF style selector.
My selector looks like:
public class ListViewItemStyleSelector : StyleSelector
{
public override Style SelectStyle(object item, DependencyObject container)
{
var listView = ItemsControl.ItemsControlFromItemContainer(container) as ListView;
...
Making a separate question, related to comments on the answer to http://stackoverflow.com/questions/2481946/wpf-4-what-happened-to-datagridcolumnheader
It appears I can use DataGridHeaderBorder in a UserControl, stand-alone in a ResourceDictionary, but not in a Style's setter of a Template.
<ResourceDictionary xmlns="http://schemas.mic...
I have a Table with 4 columns inside a FlowDocument. I've set the width of the columns but when viewed in FlowDocumentReader, when in Page Mode or 2 Page Mode, the right most column is truncated.
<FlowDocument >
<Table BorderBrush="Black" BorderThickness="1">
<Table.Columns>
<TableColumn Background="Red" Width="120" />
...
I have XmlDataProvider pointed to external content file as a staticresource.
And then I have Combobox whose ItemsSource is bound a node from the xml.
The first time I unroll combobox there is lag. Second time there is no lag.
I'm thinking this is due to fact that contents are lazy loaded from disk.
How do I reduce this lag?
...
What is the best way to make my C#/WPF application support different languages?
I want to be able to give my users the choice to choose a language.
Thanks
...
I have a window that is hosting a user control. I wish to pass (raise) events in the parent window that should reach the user control.
How do I define events in the parent window that the child user control can also receive.
...
I'm trying to set a data grid's cell's tooltip to be equal to the text inside of a TextBlock in that cell. What I have so far is this:
<Style x:Key="CellStyle" TargetType="{x:Type DataGridCell}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
...
I have a bug to fix a hyperlink in a WPF app that can't be tabbed to. The control is skipped when you go forward, but if you tab backward (shift-tab) the link will get focus!
The window is set up with several panels: a top panel (usercontrol) where the link is, a main panel beneath with form content, and a toolbar on the right. Tabbing ...
Should be a simple one, but I can't work out how to do it. Using WPF4 I want to Bind Ctrl+- to Zoom Out and Ctrl+= to Zoom In:
<KeyBinding Command="{Binding Content.ZoomInCommand}" Gesture="Ctrl+="/>
<KeyBinding Command="{Binding Content.ZoomOutCommand}" Gesture="Ctrl+-"/>
However, I'm getting errors: in the case of Ctrl+=:
R...
Hello all,
Let's say I've created a UserControl with the following ContentTemplate defined in XAML:
<UserControl.ContentTemplate>
<DataTemplate>
<Ellipse Name="myEllipse" Stroke="White"/>
<ContentPresenter Content="{TemplateBinding Content}"/>
</DataTemplate>
</UserControl.ContentTemplate>
How would I access ...
I'm using C# and Caliburn.
Is there a global way to catch all exceptions in all view models?
What about when there is some kind of exception during import from a DI/IoC container?
I basically want to display a message box when this occurs.
The RescueAttribute looks to me like it would have to be put on every single view model class...
I am using VS2010 VB.NET, working on a solution that has a number of projects. I have been developing on it for a while now, and in an attempt to debug a custom class inherited from ObservableCollection (which by the way would not load symbols when debugging even though it was apparent that the breakpointed line was being called), I cha...
I have an issue with a datagrid inserting/updating rows twice. The datagrid is bound to an observable collection that has an ItemEndEdit event added to it:
/// <summary>
/// extends the ObservableCollection class to include adding an ItemEndEdit event
/// </summary>
public class ObservableProjectExpenseItems : ObservableCollection<Proje...
Hello,
I have the following ResourceDictionary that gets merged into my Themes/Generic.xaml file
<DataTemplate DataType="{x:Type model:RequirementResourceRelation}" x:Key="{x:Static local:Resources.RequirementResourceRelationListTemplateKey}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
...
I've noticed that when I make a change to the visual presentation of a window while the window is hidden, the changes are not immediately visible when the window is shown. Rather, the window appears briefly in the state it was in when it was last-visible, taking 0.5-1 seconds to display the updated form.
This can be confusing and ugly a...
I have a basic Windows Phone List application, with code like this in the MainViewModel class
// CODE THAT WORKS --
Items.Clear();
foreach (var itm in e.Result)
Items.Add(itm);
Count = Items.Count;
// CODE THAT DOES NOT WORK -- I'm trying to understand WHY
Items = e.Result;
The databinding Xaml looks like this:
<DataTemplate...
I want to be able to implement an ItemsControl with dragable items. The reason for the ItemsControl is so I can bind to my ViewModel in the background.
I've tried using a Thumb Control in a canvas and it works perfect, except as soon as I stick it in an ItemsControl it stops working. Here is what I tried:
<ItemsControl ItemsSo...
I have ToggleButton with an OuterGlowBitmapEffect applied to it. I animate this glow to give it a pulsating effect, drawing peoples attention to it. My problem is, if I slow the animation down for the duration of a second, it stutters a lot. How can I prevent the stutter from occurring and what is it that's causing it to not be smooth?
...