|
Jeremy's answer is indeed validated by this article[^].
"The default value is "Portable User Interface", which is described in the "Supported Local Fonts" section of this topic. FontFamily can include a URI string that references a font file (and a family within the file, separated by a # character). This is for a case where rather than using fonts on the user system, you distribute the font file as part of your application's primary assembly."
|
|
|
|
|
Hi To All
I need to add the footer in DataGrid of Silverlight but i did not find any method to add the footer. the itemsource of datagrid set at run time so number of rows in datagrid may be changed every time.
Is any way to add the Footer in DataGrid?
Thanks
Sudhir
|
|
|
|
|
This link[^] might actually help you create a custom footer for your application.
|
|
|
|
|
Hi All,
I have drawn a closed path in a canvas that contains a multiscale image. So the closed path is drawn over the multiscaleimage. However, the multiscale image MouseMove and MouseWheel events do not work when the mouse pointer is over the closed path. The multiscale image mouse events only work in the image places outside the path. How to make the multiscale image mouse events work in the closed path?
Thanks in advance for your help,
Luis Nambiar
|
|
|
|
|
Setting the IsHitTestVisible property to false should do it.
|
|
|
|
|
Hi,
I'm busy with a Silverlight 5 project in which it's needed to upload PDF docs. A manager should be able to quickly preview these docs in the app. So all I need is to have a way to view the PDF contents in my Silverlight app. I have found a few solutions on the net, but almost all of them have a whole list of other features I will never use and as a result cost an arm an a leg.
So I thought the easiest way would be to convert the PDF pages into images as silverlight has no trouble displaying images. All I should need is a way to open the doc and then convert each page into an image. I'd like to be able to do this without a round trip to the server.
I know I can use an IFrame in a popup or something on top of the silverlight app, but right now that's my last resort.
Hope you can help,
Thanks
|
|
|
|
|
I'm trying to do this
<TextBlock Text="{Binding Path=Caption}"
Foreground="SlateBlue"
FontSize="14">
<TextBlock.Triggers>
<DataTrigger Binding="{Binding IsCurrentItem}" Value="True">
<Setter Property="FontWeight" Value="Bold"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsCurrentItem}" Value="False">
<Setter Property="FontWeight" Value="Normal"/>
</DataTrigger>
</TextBlock.Triggers>
</TextBlock>
and it won't compile with
Cannot find the static member 'FontWeightProperty' on the type 'ContentPresenter'.
How can I set the font weight based on a bool in my data model?
If it's not broken, fix it until it is
|
|
|
|
|
<Setter Property="TextBlock.FontWeight" Value="Bold"/>
|
|
|
|
|
Ok, that now compiled. When I run it, I get:
Triggers collection members must be of type EventTrigger.
Not even sure what that means.
If it's not broken, fix it until it is
|
|
|
|
|
Unfortunately, you can only use triggers like that in a Style. So define a Style for the TextBlock, and put your triggers in there.
(Yes, it's very annoying)
|
|
|
|
|
You need to call a DataTrigger from inside a style. Now, what you could do is set the style up so that you set the FontWeight normally, and then you would only have to apply the condition to change the weight. You don't actually need both conditions, because styles always revert back to their defaults when the trigger condition is no longer met.
|
|
|
|
|
Ok, I'v been working with this, but I can't get it quite right.
I have a disabled list which acts as a table of contens for a series of 'pages'. When a page becomes active, the TOC item for it needs to be bold.
So here's my list:
<ListBox Grid.Row="1"
Grid.Column="0"
Width="225"
ItemsSource="{Binding TOC}"
BorderBrush="SlateBlue"
BorderThickness=".5"
Padding="10"
IsEnabled="False">
<ListBox.Resources>
<DataTemplate DataType="{x:Type models:TOCModel}">
<StackPanel Orientation="Horizontal"
Margin="2">
<TextBlock Text="{Binding Caption}">
</TextBlock>
</StackPanel>
</DataTemplate>
</ListBox.Resources>
</ListBox>
and here's my style:
<Style TargetType="{x:Type ListBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}">
<Grid Width="Auto"
Height="Auto">
<Border x:Name="Border"
BorderBrush="SlateBlue"
BorderThickness=".5"/>
<ScrollViewer Focusable="false"
IsTabStop="False"
Margin="8"
HorizontalScrollBarVisibility="Disabled">
<StackPanel IsItemsHost="true"/>
</ScrollViewer>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Background" Value="White"/>
</Style>
The list is bound to a collection of TOCModels:
public class TOCModel
{
public string Caption { get; set; }
public bool IsCurrentItem { get; set; }
}
I think I need a DataTemplate for the TOC Items to set the FontWeight to bold when IsCurrentItem = true, but I don't know where to add it.
Could use some help.
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
Add the following style:
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsCurrentItem}" Value="True">
<Setter Property="FontWeight" Value="Bold" />
</DataTrigger>
</Style.Triggers>
</Style> This will get applied to all ListBoxItem elements and set the font weight appropriately.
|
|
|
|
|
how i can create graph in wpf
santy143all
|
|
|
|
|
By writing some code. Seriously, this is not a good question, if you paste this into Google you will get lots of suggestions which you can at least learn from.
|
|
|
|
|
There are a number of third party tools that you could use to implement charts.
The WPF / Silverlight toolkit itself has its own set of chart controls that you can use.
|
|
|
|
|
|
I have ViewModel that has implement IDataErrorInfo interface. Binding is working fine but Now I have a requirement that error Template should not be shown until user lost focus through the Text Box. Currently when form Loaded all the fields are validated and showing red border.
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|
|
You could toggle a boolean variable that is set when you are loading data and reset once this is done.
Only allow the validation code to run when the state of the bool is false.
E.g.
If (!load)
{
}
|
|
|
|
|
I'm working on some code that will ultimately be used in a Windows service, but right now it's in a console app for easier development.
I want to render a WPF TextBlock control to an image. I'm trying to use RenderTargetBitmap , and it's creating a png file on the expected dimensions, but the file is empty (well, it's 2K in size, but there's nothing in it).
Can anyone tell me how to do what I'm trying to do?
".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
|
|
|
|
|
After reading your question, I did a search and came across this article[^].
Maybe wrapping the visual into a VisualBrush and then painting the DrawingContext is what you are looking for?
The author has attached a small sample program as well.
|
|
|
|
|
Well, that example assumes a complete WPF app, which isn't what I'm doing (remember, I'm doing a console app/windows service), but I'll see if it works...
".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
|
|
|
|
|
No change.
".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
|
|
|
|
|
*Groan* I honestly thought this fix would help you.
I wonder what the issue is?
|
|
|
|
|
I was honestly hoping it would.
".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
|
|
|
|