|
I generally use both VS and blend at the same time....I'm getting more and more used to
which stuff works better on one or the other.
It's frustrating though - I hate having to leave something out or do something different
because something doesn't work in and/or crashes the designer(s).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
BTW, have you submitted this as a bug on Microsoft Connect?
If not, I'll do it....
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It looks like someone has already done it here.[^]
|
|
|
|
|
Cool. Marked as fixed too.
Thank you
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm developing wpf application comprising of multiple usercontrols hosted in a main user control. This main user control can be hosted from winforms or wpf win app or a MSOffice Word Document Level Addin. Currently hosting the main user control from a winforms exe.
Whenever the application is minimized and restored, one of the user control hosting 3 itemscontrol (primarily a collection of textblock & textbox controls in a stackpanel) bound to custom objects, is always rendered blank. Upon resizing the window manually, it is displayed properly. I'm clueless, as to how to refresh the display to render the constituent controls in itemscontrol. Whereas hosting as a MSOffice Word Document Level Addin, even first time rendering, itemscontrol is blank.
I tried InvalidateVisual() & InvalidateMeasure() on the maincontrol and the concerened usercontrol, but of no use. Any help greatly appreciated.....
|
|
|
|
|
a shot in the dark here:
the PropertyMetadataOptions value passed in to the PropertyMetadata of a dependencyproperty that hosts the controls might affect how/when the rendering takes place.
|
|
|
|
|
How to change the propertymetadata options to make it work? Strange thing is if the window is resized or the control is resized manually from the window shown, the user control holding all items control displays properly.
I tried UpdateLayout on the main usercontrol, constituent user controls and also refresh on the windows form that hosting the main control, but no use!
How do I force a updatelayout on the wpf user control? UpdateLayout, InvalidateArrange, InvalidateVisual...nothing seems to work.
|
|
|
|
|
Well, I found the bug. ItemControls were inside a 3rd party actipro navigation pane control. Once I removed the pane control and displayed the itemscontrol in a simple grid, voila, it worked.
Thanks for all the inputs. I'll escalate to Actipro Software. But learnt a lot on wpf layout though!
|
|
|
|
|
I was thinking about making a scaled down spreadsheet like on google docs but with silverlight. Anybody else try something similar to this yet?
Mine is only going to do simple math and have text and maybe span columns a-f and rows 1-50.
Right now the idea is to store the formulas in a separate database table from the values, and i'm going to use grammar like <math> and <text> for to denote what each cell does.
If anybody has any comments, it would be greatly appreciated.
thanks.
|
|
|
|
|
Hi all!
Could you please help me with my problem. I am writing an app that allows users to drag controls over a canvas and have met the following strange behaviour: wpf performance slowsdowns as soon as a button on a form receives focus. This is so strange to me. I've posted a code of a sample app, please try to click on a red rectangle, and move the mouse holding left button. You should see that rectangle follows the cursor pretty fast. But if you click (or even press Tab to give the button a focus) and try to drag the rectangle again - you will see that now rectangle is not as fast as before.. The recrangle will be still slow if you click Tab again and give focus to the textbox.
Do you know why it happens and how I can avoid it?
<Window x:Class="ButtonSpeedTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="627" Width="580">
<Canvas Background="Wheat" MouseMove="MyMouseMove">
<Button Canvas.Left="30" Canvas.Top="30" Height="37" HorizontalAlignment="Left" Name="button1" VerticalAlignment="Top" Width="66">Button</Button>
<Rectangle MouseDown="MyMouseDown" MouseUp="MyMouseUp" MouseMove="MyMouseMove" Name="rect" Canvas.Left="100" Canvas.Top="100" Fill="Red" Stroke="Black" Width="70" Height="50" />
<TextBox Canvas.Left="246" Canvas.Top="37.52" Height="23" Name="textBox1" Width="120" />
</Canvas>
</Window>
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace ButtonSpeedTest
{
public partial class Window1 : Window
{
bool isDragging;
public Window1()
{
InitializeComponent();
}
private void MyMouseDown(object sender, MouseButtonEventArgs e)
{
isDragging = true;
}
private void MyMouseUp(object sender, MouseButtonEventArgs e)
{
isDragging = false;
}
private void MyMouseMove(object sender, MouseEventArgs e)
{
if (isDragging)
{
Point position = e.GetPosition(this);
rect.SetValue(Canvas.LeftProperty, position.X - rect.Width / 2);
rect.SetValue(Canvas.TopProperty, position.Y - rect.Height / 4);
}
}
}
}
Thanks,
Sergey.
|
|
|
|
|
Just a guess - The animated background, at least on the default Vista
theme, may be slowing things down *shrug*
FWIW - I played around with your code-behind a bit. Here's what I was using
(changes marked in red):
bool isDragging;
private void MyMouseDown(object sender, MouseButtonEventArgs e)
{
<code>Mouse.Capture(rect);</code>
isDragging = true;
}
private void MyMouseUp(object sender, MouseButtonEventArgs e)
{
<code>if (isDragging)
{
Mouse.Capture(null);</code>
isDragging = false;
<code>}</code>
}
private void MyMouseMove(object sender, MouseEventArgs e)
{
if (isDragging)
{
Point position = e.GetPosition(<code>canvas</code>);
rect.SetValue(Canvas.LeftProperty, position.X - rect.Width / 2);
rect.SetValue(Canvas.TopProperty, position.Y - rect.Height / 4);
<code>e.Handled = true;</code>
}
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Thanks for your reply.
You are right about Vista themes. I've noticed that this effect can be seen only on Vista with enabled Aero.. If Aero is disabled - everything works perfectly.
However with Aero turned on - I see performance decrease even with your corrections to my code.
Thanks,
Sergey.
|
|
|
|
|
In addition to Jammer's suggestion...
You can always use your own button template instead of the default
themed button template.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I've noticed that if you have a window with "Allows Transparency" set to true and then an animation that manipulates a UIElement Opacity setting things can get really juddery/slow ...
This maybe your problem ...
I really noticed it using an Infragistics Chart control and a popup window in one of my projects.
The chart is animatable and the colours used in the chart are also slightly transparent.
If I set the AllowsTransparency="True" the animation ran like a dog ... turn it off and all is well.
Defo worth looking into.
|
|
|
|
|
Hi all,
i'm trying to find out how print in WPF...
My purpose is print a report(bill,price list,etc etc..) that i create but i don't know how print.
if you have any idea,advice or link i will thanks you in anticipate .
Have a nice day.
Best Regards,
Bye
|
|
|
|
|
A simple google search for "WPF print" returned 1,080,000 results.
I believe there must be something out there to help you...
|
|
|
|
|
You have to create an Xps document in memory in order to print it.
|
|
|
|
|
One way that I have used: FlowDocumentReader pages. The reader has a simple print method, and the pages can be designed hierarchical and can use WPF controls.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hi All,
We just getting to the point of running some demo's of an application we've built and we're having a few performance problems running the app on a handful of these laptops:
http://www.dell.com/tablet?s=biz&cs=555[^]
Unfortunately we've bought 4 of them ... anyway ...
The app runs fine on every other machine we've tried it on, I've also tested my own WPF app on these laptops and that performs equally poorly.
Does anyone have any ideas on what could be causing this drop in performance? Could it be related to the touchscreen?
The main grid control in use in both apps is the XamDataGrid from Infragistics.
I'm just wondering if there is a load of extra user input stuff going on due to the touchscreen that maybe slowing the grid down?
Any ideas would be great.
Thanks,
|
|
|
|
|
Hello
Iam trying to run a WPF application, but no data is dsplayed in the Grid.
The relevant codebehind file is as under Window1.xaml.vb
Private Sub BindData()
Dim conn As SqlConnection = New SqlConnection
Dim command As SqlCommand
Dim dataadp As SqlDataAdapter = New SqlDataAdapter
Dim dtTbl As Data123DataSet = New Data123DataSet
Dim query As String = "SELECT EntityCode, Title, Name FROM dbo.Entity"
Dim connstring As String = "Data Source=SRITANU;Initial Catalog=Data123;User ID=sa"
conn = New SqlConnection(connstring)
Try
command = New SqlCommand(query, conn)
conn.Open()
dataadp.SelectCommand = command
dataadp.Fill(dtTbl, "Entity")
DataContext = dtTbl
Catch ex As Exception
conn.Close()
End Try
End Sub
The XAML code is as under Window1.xaml :
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="670" xmlns:c1grid="http://schemas.componentone.com/wpf/C1DataGrid" WindowState="Maximized">
<Grid Width="574">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="574*" />
<ColumnDefinition Width="0*" />
</Grid.ColumnDefinitions>
<c1grid:C1DataGrid Margin="0,12,0,21" DataContext="{Binding dtTbl}" Name="C1DataGrid1" ItemsSource="{Binding Path=Data123DataSet.dtTbl, ElementName= Window, Mode=Default}">
<c1grid:C1DataGrid.Columns>
<c1grid:Column Caption="CUSTID" ColumnName="EntityCode" PropertyName="EntityCode " />
<c1grid:Column Caption="TITLE" ColumnName="Title" PropertyName=" Title"/>
<c1grid:Column Caption="NAME" ColumnName="Name" PropertyName=" Name"/>
</c1grid:C1DataGrid.Columns>
</c1grid:C1DataGrid>
</Grid>
</Window>
Please point out my mistake. Iam quite befuddled
Best Wishes ....... ARIJIT
|
|
|
|
|
It looks like you've set the DataContext for the window to dtTbl so
you should just need to do something like this:
<c1grid:C1DataGrid Margin="0,12,0,21" Name="C1DataGrid1" <code>ItemsSource="{Binding}"</code>>
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I made the changes and it worked.
THANKS !
Best Wishes ....... ARIJIT
|
|
|
|
|
I made the changes and it worked.
THANKS !
Best Wishes ....... ARIJIT
|
|
|
|
|
You're welcome!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I add a expander to a window and the double animation when is expanded. However, the to property of the doubleanimation is hardcoded, in my example, the "to" property is 200 and 400. I want to ask that how could it binding to the actual width or height of the expander control? Is this possible?
<Expander Grid.Column="3" Grid.RowSpan="2" Header="expander1" Margin="3,12,-83,18" Name="expander1" BorderBrush="Red" BorderThickness="2" Width="200" Height="400">
<StackPanel>
<Button Width="100">This is the button one</Button>
<Button Width="100">This is the button two</Button>
</StackPanel>
<Expander.Triggers>
<EventTrigger RoutedEvent="Expander.Expanded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="expander1" Storyboard.TargetProperty="Width"
From="0" To="200" Duration="0:0:0.25" />
<DoubleAnimation Storyboard.TargetName="expander1" Storyboard.TargetProperty="Height"
From="0" To="400" Duration="0:0:0.25" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Expander.Triggers>
</Expander>
thanks.
|
|
|
|