|
Andrew,
Can you provide a few more details so we can lend you a hand.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi everyone,
i am trying to export listview data to xps using c#.net3.5, wpf. is it possible to export to xps? if it is possible means give me some samples.
regards
Kanna
|
|
|
|
|
Hello sir even i'm trying to do that. If u get please let me know.,..
|
|
|
|
|
Hi All,
I'm having some trouble using some XAML and an attached property to vary a graphic in the UI. It seems to be intermittently working!! I was testing a Debug and Release version and all was working well but I've just fired it up again and its whacko!!
The XAML is:
<DataTrigger Binding="{Binding Path=(local:TreeViewItemProps.IsRootLevel),
RelativeSource={RelativeSource AncestorType={x:Type TreeViewItem}, Mode=FindAncestor}}" Value="True">
<Setter TargetName="img" Property="Source" Value="/SampleSort.Modules.Browser;component/Graphics/diskdrive.png" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=(local:TreeViewItemProps.IsRootLevel),
RelativeSource={RelativeSource AncestorType={x:Type TreeViewItem}, Mode=FindAncestor}}" Value="False">
<Setter TargetName="img" Property="Source" Value="/SampleSort.Modules.Browser;component/Graphics/folder.png" />
</DataTrigger>
The error I get is:
Cannot convert string '/SampleSort.Modules.Browser;component/Graphics/diskdrive.png' in attribute 'Source' to object of type 'System.Windows.Media.ImageSource'. Cannot locate resource 'graphics/diskdrive.png'.
I don't get why its randomly stopped working. I haven't touch *any* code since working on this app yesterday!
|
|
|
|
|
Jammer,
If you're testing a Boolean value, then you only need one trigger and not two. Assign one of the images as the default and trigger on the other value to swap.
If this drives you crazy and you can't get it to work, I've always just used a TemplateSelector to solve issues like this.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi Karl,
That makes complete sense <slaps forehead>, i'll just pop off and fix this.
|
|
|
|
|
Hello everyone,
In Design-Time we can add a (for example) button into a ListBox, something like this:
<ListBox Margin="120,34,0,49" Name="listBox1" HorizontalAlignment="Left" Width="147">
<ListBoxItem>
<Button Width="141">I'm a ListBox Item!</Button>
</ListBoxItem>
</ListBox>
My question is can we Dynamically declare a ListBoxItem like this?
Thanks.
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Without any doubt.
XAML is just markup that creates instances of objects and sets their properties.
Ex: listBox1.Items.Add(New Button)
In WPF, any control that has a Context property, you can basically put anything you want it in and it will be happy.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Thank you very very much
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Hi,
I am developing WPF custom controls.
Is there a way to get notification when a property value in changed by
the Visual studio IDE xaml Editor ( not through the Property dialog).
I need the notification in custom control class
|
|
|
|
|
|
Hi, this has been bothering and stressing me out lately although I googled and searched this site, so I am going to explain it straight forward and hopefully someone can help.
I have a tabcontrol, which has no tabitems on startup. I have multiple user controls. How would I be able to create a tabitem on the tabcontrol by a click of a button and use the binded user control for that particular button. It would help much very much if sample sourecode is provided, thanks!
|
|
|
|
|
The following XAML adds in an empty tabcontrol. The button click event is used to trigger the tab add:
<Window x:Class="SimpleWpfTabTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="20" />
</Grid.RowDefinitions>
<TabControl Name="myTab" Grid.Row="0">
</TabControl>
<Button Name="btnAddTab" Grid.Row="1" Click="btnAddTab_Click" />
</Grid>
</Window> Then the code for the tab add.
private void btnAddTab_Click(object sender, RoutedEventArgs e)
{
TabItem child = new TabItem{Name="childTab" + myTab.Items.Count.ToString(), Header="Added"};
StackPanel childPanel = new StackPanel();
child.Content = childPanel;
Button myButton = new Button { Name = "hello", Content = "Woopee" };
childPanel.Children.Add(myButton);
myTab.Items.Add(child);
child.Focus();
}
|
|
|
|
|
hehe ... we must have hit send at almost the same time ...
|
|
|
|
|
Great minds and all that.
|
|
|
|
|
Oh give over ... your solution kicks mine in the butt ...
|
|
|
|
|
No it doesn't. Yours hits the spot - so 5ed it.
|
|
|
|
|
Thanks man! Backatcha!
I still think yours is neater tho :P
|
|
|
|
|
Rough and dirty!!!
<Window x:Class="AddTabItem.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="25" />
</Grid.RowDefinitions>
<TabControl x:Name="TabControl1"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Grid.Column="0" Grid.Row="0" Grid.RowSpan="1" />
<Button x:Name="btnAddTab" Content="Add Tab" Click="btnAddTab_Click"
Grid.Row="1" Grid.RowSpan="1"/>
</Grid>
</Window>
namespace AddTabItem
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void btnAddTab_Click(object sender, RoutedEventArgs e)
{
AddTabs();
}
private void AddTabs()
{
TabItem tabitem = new TabItem();
Button button = new Button();
button.Content = "Added Button!";
tabitem.Content = button;
TabControl1.Items.Add(tabitem);
TabControl1.SelectedIndex = TabControl1.Items.Count;
}
}
}
|
|
|
|
|
Thanks for the helpful responses. It works very well however, how am I able to define a specific User Control that I want to be added as the new tab item in the tab control based on click of the button.
Also I would like to ask what would be the best way of doing this and the terminologies, resources (I will do the coding myself)
I have a program which utilizes the Tab Control as the main user interface. It also has a toolbar with many tools, when clicked on a tool from the toolbar, the tool's user interface options will be placed in the Tab Control area, the name of the Tool will be like a Tab Header, any events, extra options in the Tool will be displayed as extra Tab Items in the Tab header. Since the toolbar will have many tools and if clicked on, they will do the same but not overwrite the current launched tool interface but create a separate Tab Header, and Tab Items if necessary. I hope I explained it correctly, if not I will be more than happy to create a Picture for better understanding. Basically the program is a big Tab Control, its tool options/anything else are smaller Tab Controls. Thanks for any suggestions or help.
|
|
|
|
|
|
Can you also share the comparison between your tool and agTweener or other SL Animation Library?
|
|
|
|
|
Mole is a debugger visualer. Silverlight does not support debugger visualizers. This is on SL product that does some of what Mole does in SL. I just don't remember the name.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
ListView doesnt support keyboard navigation.Is there any solution for this?
|
|
|
|
|
Well - I'm not sure how you've created your ListView, but this one does:
<Window x:Class="KeyViewListView.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<StackPanel>
<ListView x:Name="MyList" HorizontalAlignment="Left" >
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" Width="200" />
<TextBlock Text="{Binding Path=Age}" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
</Window>
|
|
|
|