|
rdinca wrote: Is there any possible way to render a UserControl immediately after I update one of its fields ?
You can use INotifyPropertyChanged to trigger an update on the UI.
However, on the whole, forcing a delay of 10seconds as the UI is refreshing is really not a good way to code.
You can use an asynchronous call and refresh the UI once the data returns from this call but putting in a delay is not a good practice at all.
|
|
|
|
|
As I told you, the code is just an example made up by me in order to get the question right.
Please read the entire post and if you don't understand what I need I will made up a new example based on the real coding needs.
Thank you,
Adrian
|
|
|
|
|
I have gone through your post.
You should be updating the textbox using Binding and INotifyPropetyChanged (not with a timer).
The UI should update automatically when the end of the method is hit.
Using a timer is not the right way to refresh your UI.
|
|
|
|
|
Sounds like you are doing something VERY wrong...
Adding user controls by hand, updating text boxes by hand, etc.
Sounds like you are writing WPF code in Winforms style... NOT the way to go. Write WPF code in the WPF way and everything will work magically .
|
|
|
|
|
I am trying to get content of a WPF data grid cell using this method:
...objGrid.ItemsSource.Item(<rownumber>).ColumnName
Question is how can I parameterize the columnname instead of having to hardcode it? For example, can I do something like this:
..objGrid.ItemsSource.Item(<rownumber>).Column("<columname">) ????
OR like this..
..objGrid.ItemsSource.Item(<rownumber>).Column("<column number>") ????
I am trying to get away from having to hardcode the columnname. (Long story short, this is for a test automation script that needs to be data driven.)
Any suggestions most welcome!
Thank you!
|
|
|
|
|
But but why are you working on the data via the UI, surely you would work with the bound collection!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Good point, Mycroft However, this is a for a test automation script. The automated test script needs to validate cell values on the grid (UI) as it navigates through the application under test.
There are no failures.. only extended learning opportunities.
|
|
|
|
|
I am not using any image or Ischecked property in left grid in MENU control(WPF). so i want to remove it.
|
|
|
|
|
Get a copy of the menu template. Look for the following code:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="17" SharedSizeGroup="MenuItemIconColumnGroup" Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto"/>
<ColumnDefinition Width="14"/>
</Grid.ColumnDefinitions>
<ContentPresenter
x:Name="Icon"
ContentSource="Icon"
Margin="4,0,6,0"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="Center"/>
<Path
x:Name="GlyphPanel"
Data="{StaticResource Checkmark}"
Fill="{TemplateBinding Foreground}"
FlowDirection="LeftToRight"
Margin="4,0,6,0"
Visibility="Hidden"
VerticalAlignment="Center"/>
<ContentPresenter
Grid.Column="1"
ContentSource="Header"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
<Path
Grid.Column="3"
DockPanel.Dock="Right"
Data="{StaticResource RightArrow}"
Fill="{TemplateBinding Foreground}"
Margin="4,0,6,0" VerticalAlignment="Center"/> Change it to
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto"/>
<ColumnDefinition Width="14"/>
</Grid.ColumnDefinitions>
<ContentPresenter
Grid.Column="0"
ContentSource="Header"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
<Path
Grid.Column="2"
DockPanel.Dock="Right"
Data="{StaticResource RightArrow}"
Fill="{TemplateBinding Foreground}"
Margin="4,0,6,0" VerticalAlignment="Center"/> You will also have to hunt for the Triggers for the Icon and Glyph and remove them.
|
|
|
|
|
I have a WPF app, AppA, that has a button that launches AppB.
When I run it from VS2011 Beta, AppB is opened and switched to desktop. When I run it
from Metro, the app started but does NOT switch to desktop.
Anyone have any thoughts on this?
Everything makes sense in someone's mind
|
|
|
|
|
By default, Metro doesn't know about the desktop (the desktop is just another application which runs from Metro). The reason it works in VS is that VS is already running inside the desktop - so it's not a problem to do this. BTW - how are you trying to run a WPF app from Metro? WPF isn't targetted for Metro - it's the desktop solution.
|
|
|
|
|
We have a middle-tier app that accepts a uri and launches the target app.
Everything makes sense in someone's mind
|
|
|
|
|
Without seeing any code, we can't even begin to guess (although I assume you are using Launcher.LaunchDefaultProgram). Sorry.
|
|
|
|
|
That's exactly what I'm doing.
Everything makes sense in someone's mind
|
|
|
|
|
So how do you get a WPF app to run from metro?
Everything makes sense in someone's mind
|
|
|
|
|
I misread your question, I thought you meant you were trying to launch a WPF from another WPF app running in Metro.
|
|
|
|
|
Anyone have any resources for getting started developing WPF apps on Windows 8? I have been to MSDN and Googled alot, but since Windows 8 is still in preview, there's not alot out there as far as development resources.
Thanks
Everything makes sense in someone's mind
|
|
|
|
|
I am writing code for a WPF application in VS C# Express 2010. I need to use the Windows API code pack for using the 'File Thumbnail handlers' provided by the API. I downloaded and installed the code pack but when I open the WindowsAPICodePack solution in Express, and try to build it, it shows 16 errors. I have put two of them here :
Error 16 Metadata file 'C:\Users\General\Documents\Windows API Code Pack 1.1\Windows API Code Pack 1.1\source\WindowsAPICodePack\Shell\bin\Debug\Microsoft.WindowsAPICodePack.Shell.dll' could not be found
Error 11 The type 'System.Windows.Markup.IQueryAmbient' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Has anyone worked with WindowsAPICodePack in VS Express version? Does it work only with Professional and Ultimate? Please help.
|
|
|
|
|
This looks like the code pack was written in .NET3.5. System.Xaml.dll was introduced in .NET 4, so you need to update your project references to include things like System.Xaml.dll.
|
|
|
|
|
I cannot find System.Xaml in 'References' in VS Express(neither in .Net nor COM). How do I go about doing it? Could you please give more information on that?
Is it doable in the express version?
|
|
|
|
|
Right click on your references, select Add reference. Choose Assemblies from the tablist on the left and make sure that Framework is highlighted. Ensure that your dialog says .NET Framework 4 above the list of assemblies. You may have to wait a little while at first because VS builds up a list of the relevant assemblies and caches them for later use. System.Xaml is just above System.Xml if you have sorted by name.
|
|
|
|
|
When I select 'Add reference', there is no "Assemblies" tabitem in the tablist. The available ones are - .Net, COM, Projects, Browse and Recent.
|
|
|
|
|
Try. Net then. I didn't know that the express editions were so different.
|
|
|
|
|
It's under the .NET tab and only takes a couple of seconds to find it.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi... So I want to change the item template for the selected item of a listbox. I know I need to use the VisualStatemanager to do this, but I'm not sure how to do it. All of the example I've found seem to be much more complicated than I need and/or I can't get them to work.
Basically, for an unselected item, I need to display the name property. And for a selected item I need to display a few other things. So My understanding is that I should use two different grids, and use the VisualState to turn toggle the visibility of the "detail" info. Can someone throw me a simple example?
Thanks.
|
|
|
|