 |
|
 |
All WinRT discussions are now in Windows API and WinRT[^]
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
We have in our application columns wich depend of each others, thats why we wanna them stay together if the user drag a column.
In WPF if you drag a column u see it with low opacity at your mousecursor bevor your drop it, now we would like to see the other column too(wich depend of the draged column) moving with low opacity when the user drag the first column.
Any ideas?
Thanks a lot.
cheers, negada.
|
|
|
|
 |
|
 |
I have a treeview in WPF bound to a list of TreeItemEntity objects:
public class TreeItemEntity : _EntityBase
{
public string Caption { get; set; }
public string Description { get; set; }
public string ImageName { get; set; }
public bool IsExpanded { get; set; }
public TreeItemType ItemType { get; set; }
public List<TreeItemEntity> Children { get; set; }
}
In the XAML I have
<Window.Resources>
<HierarchicalDataTemplate DataType="{x:Type entities:TreeItemEntity}"
ItemsSource="{Binding Path=Children}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding ImageName}"
Height="16"
Width="16"
Margin="0,0,3,0"/>
<TextBlock Text="{Binding Path=Caption}">
<TextBlock.ToolTip>
<ToolTip>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label FontWeight="Bold"
Content="{Binding Caption}"/>
<Label Content="{Binding Description}"/>
</StackPanel>
</StackPanel>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</StackPanel>
</HierarchicalDataTemplate>
</Window.Resources>
and
<telerik:RadTreeView x:Name="tvwTree"
Grid.Row="2"
Grid.Column="0"
ItemsSource="{Binding TreeData, Mode=TwoWay}"
SelectedItem="{Binding SelectedTreeItem, Mode=TwoWay}"/>
The question is, how do I bind to the TreeItemEntity's IsExpanded property?
Everything makes sense in someone's mind
|
|
|
|
 |
|
 |
You need to declare a style that targets a TreeViewItem or whatever telerik calls it and bind the IsExpanded in there.
|
|
|
|
 |
|
 |
I have the following code from inside the UserControl.cs:
public void wait()
{
int i = 0;
while (i < 10)
{
i++;
System.Threading.Thread.Sleep(1000);
}
}
private void IsLoaded(object sender, RoutedEventArgs e)
{
wait();
}
I just want to wait 10 seconds AFTER the layout is rendered(you can see the buttons).
If i execute the code now, it will first wait 10 seconds and then it will render the layout.
I already tried with IsLoaded event for UserControl as you can see in the text and it is not working.
Now, the question I asked was in another context. The real situation is like this:
I have a Window from where I render different(Children.Add(UserControl)) UserControls after doing different calculations in the MainWindow.
The problem is that when I try to update a TextBlock from one of the UserControls by using a Method from the parent Window, the visual update(the text being modified) takes place at the end of the method. And because the operations inside the method takes a few second, a lag between action and display appears.
I have tried: UpdateLayou() after updating but it is not working.
Is there any possible way to render a UserControl immediately after I update one of its fields ?
I need to work using this architecture because I work with Windows Messages in WndProc.
|
|
|
|
 |
|
 |
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.
|
|
|
|
 |