I mean, i have one of this controls and text inside one of it's columns.
Usually if user changes column size, it's just cutting text. If I'm trying to use template with textblock or textbox and set TextWrapping="Wrap" inside of the template - it's really doesn't change anything.
What's the way out?
*And yes, I searched before asking, an...
I am currently working on an application with a tabbed interface. I want to be able to split the workspace horizontally or vertically by dragging a tab to one edge of the window.
For example, open two tabs: http://666kb.com/i/b65vvbusbxhvgy8mf.png
Then drag one tab to the bottom of the screen and drop it. A second tabcontrol should app...
I have a control with a DependencyProperty with a CoerceValueCallback.
This property is bound to a property on a model object.
When setting the control property to a value that causes coercion the Binding pushes the uncoerced value to the model object. The property value on the control is coerced correctly.
How do I get the Binding to ...
Hi,
in a WPF project with Linq to SQL, if you use the O/R - designer to create a simple structure with 3 that are all tied with forgin key relataions like so:
Customer <-- Orders <-- Items, and say i want a simpe window with 3 syncronized comboboxes
when you select a customer you see only his orders and when you select an Order you see...
The WindowsBase DLL defines the IWeakEventListener event with summary:
Provides event listening support for classes that expect to receive events through the WeakEvent pattern and a System.Windows.WeakEventManager.
This vague description doesn't describe what the 'WeakEvent pattern' actually is.
So, what is this pattern, why is it...
I want to hide the selected item from the opened WPF combo box, basically to show instead of this:
item2
item1
item2
item3
this:
item2
item1
item3
How can this be done?
...
I'm using the WPF toolkit's Calendar control to allow users to select a date. If the date is not yet selected then the property the SelectedDate is bound to is Null. This makes the Calendar default you January 1, 0 AD. I'd like to do something like
SelectedDate="{Binding UserPickedDate, TargetNullValue=Today, Mode=TwoWay}"
But both "T...
Does anyone know how to change the brush for a menu's background? This sounds simple, but I don't see any obvious way to do this. You'd think that the Background property would change it, but it doesn't.
Here's what my menu looks like (notice the default white background):
Example Image
Example Code:
<Window.Resources>
<Soli...
I want to close a tab in my tab control when the mouse wheel is clicked. How can I capture this event in WPF?
EDIT:
Here's the code:
private void tabMain_MouseDown(object sender, MouseButtonEventArgs e)
{
if(e.ChangedButton == MouseButton.Middle && e.ButtonState == MouseButtonState.Pressed)
{
MessageBox...
I have a WPF ListBox with a defined DataTemplate. In that template, I have a grid, where the first column width should take up all remaining room in the grid.
This seems to work outside the ListBox, but not inside. Why is that, and how can I get it to behave the same?
Here is my code. See line 36, and line 70
<UserControl x:Class="Ru...
Soon Windows 7 will use ribbon as default interface in any Windows programs, like Paint or WordPad, leaving to back default toolbars and menus.
Will you migrate your UI to using ribbons for Windows 7?
...
In WPF, it seems to be impossible to select (with the mouse) a "null" value from a ComboBox. Edit To clarify, this is .NET 3.5 SP1.
Here's some code to show what I mean. First, the C# declarations:
public class Foo
{
public Bar Bar { get; set; }
}
public class Bar
{
public string Name { get; set; }
}
Next, my Window1 XAML:
...
I have some UI code that needs to be updated from my background presenter thread.
So, I do the following:
from my background thread, I set my property in the UI:
_ui.ConnectionStatus = "A";
then, my set is as follows:
public string ConnectionStatus
{
set{
if (Dispatcher.CheckAccess())
ConnectionStatusTxt.Content = value;
else
{
...
I have written a WPF user control and part of it involves dynamically adding elements to a canvas which effects the height of said canvas. The canvas is nested within a grid. When I dynamically add my elements the height of the canvas changes, but the canvas ends up extending beyond the edge of the overall control rather than causing the...
I'm using the WPF 3.5SP1 WebBrowser control to display a page containing some javascript functions.
My program then needs to invoke a javascript function which will make an asynchronous call. I need a way to get the result of that asynchronous call back to C# so I can process the result.
Is there a way I can make the first javascript fu...
I'm having some problems changing the DataTemplate that is used for a TreeViewItem when it is selected. Ideally, I would like each item to contain a TextBlock, and then when selected it should contain a TextBox instead.
Here is what I have so far (I used this question as a starting point):
<Window>
<Window.Resources>
<Hiera...
Based on information in Chapter 7 of 3D Programming For Windows (Charles Petzold), I've attempted to write as helper function that projects a Point3D to a standard 2D Point that contains the corresponding screen coordinates (x,y):
public Point Point3DToScreen2D(Point3D point3D,Viewport3D viewPort )
{
double screenX = 0d, screenY = 0...
What are the best guides / tutorials / books / websites for someone with minimal experience (or none) in the world of 3D graphics programming?
I realize that the fundamentals of 3D graphics and mathematics apply across platform specific 3D library implementations such as OpenGL, DirectX, WPF etc..
Therefore it would be useful if answer...
I have custom Bitmap object that is within a styled button. I am trying to call PresentationSource.FromVisual within the Bitmap object however it is returning null.
How would I get the Parent element (in this case a Button) from within the child Bitmap object. Is there standard code to get the styled parent?
For example the WPF style...
Hi
In WPF 3.5SP1 i use the last feature StringFormat in DataBindings:
<TextBlock Text="{Binding Path=Model.SelectedNoteBook.OriginalDate, StringFormat='f'}"
FontSize="20"
TextTrimming="CharacterEllipsis" />
The problem i face is that the date is always formated in...