Click here to Skip to main content
15,891,567 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: How to display a document in silverlight? Pin
Michael Sync31-Jul-09 18:21
Michael Sync31-Jul-09 18:21 
QuestionUse Themes? Pin
#realJSOP31-Jul-09 1:09
mve#realJSOP31-Jul-09 1:09 
AnswerRe: Use Themes? Pin
Super Lloyd31-Jul-09 1:52
Super Lloyd31-Jul-09 1:52 
AnswerRe: Use Themes? Pin
Pete O'Hanlon31-Jul-09 1:53
mvePete O'Hanlon31-Jul-09 1:53 
QuestionHow to add silverlight. Pin
Blikkies30-Jul-09 21:20
professionalBlikkies30-Jul-09 21:20 
AnswerRe: How to add silverlight. Pin
Mark Salsbery31-Jul-09 5:08
Mark Salsbery31-Jul-09 5:08 
GeneralRe: How to add silverlight. Pin
Blikkies2-Aug-09 8:17
professionalBlikkies2-Aug-09 8:17 
QuestionUse XAML file as vector image Pin
Jack Valmadre30-Jul-09 12:01
Jack Valmadre30-Jul-09 12:01 
Hi,

I have a few vector images in XAML format that I'd like to display in my application. So far I've been able to do this using:
private XmlReader reader_;
private UIElement control_;
...
reader_ = XmlReader.Create(filename_);
control_ = (UIElement)XamlReader.Load(reader_);

Then having a Control property:
public UIElement Control
{
    get
    {
        return control_;
    }
}

And binding to this as below:
<DataTemplate DataType="{x:Type local:Tile}">
  ...
    <Viewbox>
      <Label Content="{Binding Control}" />
    </Viewbox>
  ...

This works, but when I try and display the control in multiple controls in the same window, only one will appear. I was able to fix it by doing this:
public UIElement Control
{
    get
    {
        XmlReader reader = XmlReader.Create(filename_);
        return (UIElement)XamlReader.Load(reader);
    }
}

But I'd really like to avoid parsing the XAML and reloading the control every time I use it! This is my first WPF project. Can someone recommend a better way of doing this?

Cheers!

Jack

AnswerRe: Use XAML file as vector image Pin
Christian Graus30-Jul-09 13:57
protectorChristian Graus30-Jul-09 13:57 
QuestionHow to define windows property in resourcedictionary Pin
vidster30-Jul-09 3:23
vidster30-Jul-09 3:23 
AnswerRe: How to define windows property in resourcedictionary Pin
Pete O'Hanlon30-Jul-09 4:35
mvePete O'Hanlon30-Jul-09 4:35 
GeneralRe: How to define windows property in resourcedictionary [modified] Pin
vidster30-Jul-09 5:37
vidster30-Jul-09 5:37 
GeneralRe: How to define windows property in resourcedictionary Pin
Pete O'Hanlon30-Jul-09 8:46
mvePete O'Hanlon30-Jul-09 8:46 
GeneralRe: How to define windows property in resourcedictionary Pin
vidster30-Jul-09 23:21
vidster30-Jul-09 23:21 
GeneralRe: How to define windows property in resourcedictionary Pin
Pete O'Hanlon31-Jul-09 1:08
mvePete O'Hanlon31-Jul-09 1:08 
GeneralRe: How to define windows property in resourcedictionary Pin
vidster31-Jul-09 1:18
vidster31-Jul-09 1:18 
QuestionGood reputable C# tutorials for beginners Pin
copec30-Jul-09 1:50
copec30-Jul-09 1:50 
AnswerRe: Good reputable C# tutorials for beginners Pin
Christian Graus30-Jul-09 10:51
protectorChristian Graus30-Jul-09 10:51 
GeneralRe: Good reputable C# tutorials for beginners Pin
copec30-Jul-09 17:10
copec30-Jul-09 17:10 
AnswerRe: Good reputable C# tutorials for beginners Pin
BillWoodruff2-Aug-09 5:59
professionalBillWoodruff2-Aug-09 5:59 
QuestionAdjusting WPF Layout Controls Pin
Krishna Aditya29-Jul-09 22:09
Krishna Aditya29-Jul-09 22:09 
AnswerRe: Adjusting WPF Layout Controls Pin
Christian Graus30-Jul-09 10:53
protectorChristian Graus30-Jul-09 10:53 
RantSilverlight design Pin
Adriaan Davel29-Jul-09 21:37
Adriaan Davel29-Jul-09 21:37 
GeneralRe: Silverlight design Pin
Pete O'Hanlon29-Jul-09 22:46
mvePete O'Hanlon29-Jul-09 22:46 
GeneralRe: Silverlight design Pin
Adriaan Davel29-Jul-09 23:48
Adriaan Davel29-Jul-09 23:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.