|
Did you get it to work?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Yes, last night I refactored it, and now it works.
Many thanks
If it's not broken, fix it until it is
|
|
|
|
|
I have a wpf datagrid which I am using with the grouping feature. Is there any way to show different columns within the grid based on the grouping property. So if I have groups A and B, can i show columns 1,2,3 for group A and columns 4,5,6 for group B?
modified 10-Oct-12 4:13am.
|
|
|
|
|
I would be surprised if this is possible, you may be able to kludge it using visibility based on group but I doubt it. I'd look into sub grids or two collections, one for groups and another for the sub elements and maybe template based on the group type!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Greetings,
I created a control template inside of the xaml file where the control was. It worked. When I moved the control template and styles to the generic.xaml, they stopped working and I get an error "key attribute can be used only on a tag contained in an idictionary type property". I am fairly new to WPF and the code I am posting was modified from something that Blend created.
I'd appreciate some help getting it to work. Specifically, how do I add it to the generic.xaml and then how do I reference it in another file.
<LinearGradientBrush x:Key="MenuItemSelectionFill" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#34C5EBFF" Offset="0"/>
<GradientStop Color="#3481D8FF" Offset="1"/>
</LinearGradientBrush>
<Style>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
<Grid>
<Rectangle x:Name="Bg" Fill="{TemplateBinding Background}" RadiusY="2" RadiusX="2" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
<Rectangle x:Name="InnerBorder" Margin="5" RadiusY="2" RadiusX="2"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="32" SharedSizeGroup="MenuItemIconColumnGroup"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ContentPresenter Grid.Column="0" x:Name="Icon" Margin="0" VerticalAlignment="Center" ContentSource="Icon"/>
<ContentPresenter Grid.Column="1" Margin="10" ContentSource="Header" VerticalAlignment="Center" RecognizesAccessKey="True"/>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Icon" Value="{x:Null}">
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
</Trigger>
<Trigger Property="IsHighlighted" Value="true">
<Setter Property="Fill" TargetName="Bg" Value="{StaticResource MenuItemSelectionFill}"/>
<Setter Property="Stroke" TargetName="Bg" Value="#8071CBF1"/>
<Setter Property="Stroke" TargetName="InnerBorder" Value="#40FFFFFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="{x:Type MenuItem}" TargetType="MenuItem" BasedOn="{StaticResource BaseControlStyle}">
<Style.Triggers>
<Trigger Property="Role" Value="SubmenuItem">
<Setter Property="Padding" Value="5"/>
<Setter Property="Background" Value="#F0F0F0"/>
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
</Trigger>
</Style.Triggers>
</Style>
Thanks,
Wade
|
|
|
|
|
Silvelight : Canvas with checkbox create in dynamically like theater sit booking
if i give colm=1- and row =10 , ist become Canvas row 10 checkbox come and col = 10
|
|
|
|
|
|
Hi,
I need to convert a byte[] array generated from PDF into image and show it in the UI. I dnt want to store the image file anywhere in the disk.Conversion should be using in-built memory. I tried to convert byte into bitmap image using the following code. But image is not rendered in the UI.
using (MemoryStream ms = new MemoryStream(bytes, 0, bytes.Length))
{
BitmapImage im = new BitmapImage();
im.SetSource(ms);
this.pdfImage.Source = im;
}
Is there anyother way to do this? Tools are also acceptable.
Gomathi R
|
|
|
|
|
You can't convert a PDF into an image simply by converting it into a byte array. Without the conversion to an image, the BitmapImage identifies that it cannot display the byte array, so it doesn't attempt to display it. You might want to try this[^] library for the actual conversion (there's even a small sample on saving a PDF to a png file).
|
|
|
|
|
Hi Pete,
I have tried this. But i am unable to add the dll in my Silverlight Application.
Gomathi R
|
|
|
|
|
You don't add it to the Silverlight side - you add it to the ASP.NET side, and send the byte array to the Silverlight app. That is, after all, where you are getting the PDF from isn't it?
|
|
|
|
|
Even in asp .net i am unable to add the dlls. I have added libpdf dll and tried to run the code. I got the following error. Could not load file or assembly 'libpdf.DLL' or one of its dependencies. The specified module could not be found.
Gomathi R
|
|
|
|
|
I am trying to create a basic Silverlight application that user can access via IE. The SL application will read some local registry settings (e.g. OS installed, ). Any direction/example will be greatly appreciated.
|
|
|
|
|
picasso2 wrote: Any direction/example will be greatly appreciated. Start here[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi all,
I want to set theme dynamically in my silverlight application.
How can i do this??
|
|
|
|
|
Luckily for you, someone wrote an article on how to do this here[^].
|
|
|
|
|
|
Intriguing. That's exactly the same article I linked to in the message just above this one. What, precisely, are you adding to the sum total of knowledge gained from this thread?
|
|
|
|
|
What is the point of repeating the exact same thing as Pete did. Don't you read other peoples answers before you answer, or are you just trying to gain reputation points ?
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
I have a version of Telerik and i used Scheduler view, when I change value of flow direction ,right to left , of my windows, and when I drag a inserted appointment, it does `t normally drag ,
What can I do for fix the problem?
Thanks a lot
|
|
|
|
|
Raise this with Telerik. It could well be a bug.
|
|
|
|
|
|
I change my Telerik version from 2.0 to 4.0,,, and solve it....
Is so nice!!
|
|
|
|
|
hello
My program has a ListView, which is connected to an ObservableCollection.
If I add values to the ObservableCollection, I can see them in the ListView.
But if I change an object in the ObservableCollection, the change is not seen in the ListView. The modification is made by changing the name in the textbox side and clicking the "CAMBIA"
<Window x:Class="WpfApplication3.bindingListBoxTOstring"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="bindingListV" Height="300" Width="300"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
>
<Grid>
<ListView Name="lv" ItemsSource="{Binding ListBoxCollection, UpdateSourceTrigger=PropertyChanged}" Margin="12,0,128,50" SelectionChanged="lv_SelectionChanged">
<ListView.View>
<GridView>
<GridViewColumn Header="profilo" Width="200"
DisplayMemberBinding="{Binding nome, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</GridView>
</ListView.View>
</ListView>
<Label Content="Cambia valore" Height="28" HorizontalAlignment="Left" Margin="164,23,0,0" Name="label1" VerticalAlignment="Top" Width="102" />
<TextBox Height="32" HorizontalAlignment="Left" Margin="154,56,0,0" Name="textBox1" VerticalAlignment="Top" Width="114" />
<Button Content="cambia" Height="23" HorizontalAlignment="Left" Margin="177,107,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
</Grid>
</Window>
namespace WpfApplication3
{
public partial class bindingListBoxTOstring : Window
{
ObservableCollection<ListBoxData> _ListBoxCollection =
new ObservableCollection<ListBoxData>();
public bindingListBoxTOstring()
{
InitializeComponent();
_ListBoxCollection.Add(new ListBoxData { nome = "netgear" });
_ListBoxCollection.Add(new ListBoxData { nome = "alice13" });
}
public ObservableCollection<ListBoxData> ListBoxCollection
{ get { return _ListBoxCollection; } }
public class ListBoxData
{
public string nome { get; set; }
}
private void button1_Click(object sender, RoutedEventArgs e)
{
ListBoxData x = lv.SelectedItem as ListBoxData;
x.nome = (textBox1.Text) != string.Empty ? (textBox1.Text) : string.Empty ;
}
private void lv_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ListBoxData x = lv.SelectedItem as ListBoxData;
textBox1.Text = x.nome;
}
}
}
|
|
|
|
|
The item you are editing has to notify WPF that it has changed. Just because you have an ObservableCollection , it doesn't mean that your application will be able to respond to changed inside the items that make up the collection. To enable this, you need so expose those items to the binding mechanism as well - fortunately, this is incredibly easy to do.
Change your ListBoxData class so that it (or an ancestor that you choose) implements INotifyPropertyChanged . Then, add the ability to raise a change when nome changes. For example:
public class ListBoxData : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private string _nome;
public string nome
{
get { return _nome; }
set
{
if (_nome != value)
{
_nome = value;
OnChanged("nome");
}
}
}
private void OnChanged(string propertyName)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
} Now, whenever you change nome, the PropertyChanged event is raised - and the WPF binding mechanism knows how to handle that. Changes will be reflected in the UI now.
|
|
|
|