I have a XAML MenuItem DataBound ItemsSource that is working fine however there is a small issue. When I view the MenuItem and there is no databound items the ParentMenu will be disabled and it appears fine without binding errors (as expected the ItemsSource is empty). If the ObservableCollection is modified and an item added, the bind...
I have a class,
internal class PageInformation : DependencyObject
{
public static DependencyProperty NameProperty =
DependencyProperty.Register("Name", typeof(string), typeof(PageInformation));
public static DependencyProperty PageUriProperty =
DependencyProperty.Register("PageUri", typeof(string), typeof(PageInfo...
I have created some tests in my WPF application. Right now I am working on testing single components, for example images and text blocks. If I run a single test in my unit tests, they all pass without a hitch. The problem occurs when I try run all the tests, I get the following errors in the tests that create and modify WPF components:
...
I'm looking for a WPF textarea component that would allow the user to search inside it. Something similar to the notepad, but as a reusable component.
...
I'm trying to create a "button" with a rectangle since we're gonna have different images on MouseOver, Clicked and the "normal" state.
We started to use the button control but after setting the image on it in Vista using Chrome as the theme then when hovering the button the image got blurred out.
The images are created by the graphics t...
Hi The problem am having is that I have multiple TreeView control and each TreeView has its own TreeViewItem styles,
setting it
TreeView ItemContainerStyle="{StaticResource Style1}"
will only set the root element NOT all the child elements, How to apply a style to all the child elements in a TreeView
...
When I want a window to be transparent I have to set AllowsTransparency to True.
When I set this the outer boarder(You know the close and minimize button and all) disappear also.
Oh, I am using Blend 3 to do this(Just got it, it's very nice).
...
I've created quite a satisfying 'magnifying glass' effect on a list view
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="FontSize" Value="14"/>
</Trigger>
However, what I'd really like to do is have the rows above and below set to, say, 12.
I suspect this is asking a bit to much, but just in case anyone has an ide...
What are main difference between Triggers and Events in WPF ?
We can do all the stuffs using events, which we can do through triggers, so why we need triggers?
...
I'm trying to do this:
<TextBlock Text="{Binding Path=Text,
Converter={StaticResource stringFormatConverter},
ConverterParameter='\"{0}\"'}" />
But this is apparently not the way to get a quote into a XAML binding string.
What is the appropriate way to get "\"{0}"\" to work here?
...
I'm trying to do this:
<TextBlock Text="{Binding Path=Text,
Converter={StaticResource stringFormatConverter},
ConverterParameter='&\u2014{0}'}" />
To get a to appear in front of the text. It doesn't work. What should I be doing here?
...
Hi, I have this RTF text:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial;}}
{\colortbl ;\red0\green0\blue0;\red255\green0\blue0;}
\viewkind4\uc1\pard\qc\cf1\fs16 test \b bold \cf2\b0\i italic\cf0\i0\fs17
\par }
How to set this text into WPF RichTextBox?
Solution:
public void SetRTFText(string ...
Trying to parse Maplines for an airport. Each airport can have X number of different configurations. In code behind I parse each configuration into a separate collection of custom objects which is data bound to the TabItem below. Currently this TabItem is "Hard Coded" in the XAML body. How do I create a template that I can declare fr...
Hi
I have a listview binding to an ItemsSource.
Why is the SelectionChanged event firing on the load/databoound events? I assume that it is because a 'default' items ie index 0 is selected.
How can I disable this, because when selecting an item updated other sources with data.
Thanks
Petrus
...
i write this code in my project:
DatabaseDataContext dataContext = new DatabaseDataContext();
IQueryable<Available_Time_Teacher> att = from r in dataContext.Available_Time_Teachers
where r.Teacher_ID == id
select r; ...
Hi,
Does anyone know how I can disable the text wrapping of a RichTextBox?
E.g. if I have a large string which doesn't fit in the window, the RichTextBox places the part of the string which can't be shown of a new line. I want to disable that (and make it visible only by using the Scrollbar).
Thanks a lot.
Cheers
...
Hey,I'm currently using the WPF Ribbon ctp RibbonDropDownButton and i'm binding to a collection to get from it all the items.
The problem with that is that i can't add a command for each item in that way... (when an item is selected)
I thought of an alternative to add the items when i click on the ribbon drop down button, but there isn'...
Hello,
I have a WPF datagrid and would like it's height to equal the sum of the heights of it's rows + header.
i.e. if my datagrid header is 100px and I have 4 rows, each 50px in height the total height of my datagrid should be 300px.
Is there a way of declaratively specifying that the height should match the sum of it's contents?
T...
Hi,
I am building a control, where the user can "draw" resizable rectangles that are laid over the content. To resize those rectangles, I use an Adorner on top of them which contains 4 Thumbs to change the size of the rectangle.
The problem is, that this control is is "zoomable", meaning a ScaleTransform is applied to the whole control...
I know this is an easy question but I can't figure it out or find the answer anywhere. I'm just trying to change the image source during runtime in WPF using C#. Whenever the code runs, it just removes 1.gif and has a blank white box, instead of displaying 2.gif. Thanks in advance.
XAML:
<Image x:Name="img" Height="150" Margin="142,...