Click here to Skip to main content
15,311,151 members
Home / Discussions / WPF
   

WPF

 
QuestionProblem in flow direction when value is right to left in Telerik Pin
Hossein Khalaj3-Oct-12 20:19
MemberHossein Khalaj3-Oct-12 20:19 
AnswerRe: Problem in flow direction when value is right to left in Telerik Pin
Pete O'Hanlon3-Oct-12 20:21
mvaPete O'Hanlon3-Oct-12 20:21 
GeneralRe: Problem in flow direction when value is right to left in Telerik Pin
Hossein Khalaj3-Oct-12 20:23
MemberHossein Khalaj3-Oct-12 20:23 
GeneralRe: Problem in flow direction when value is right to left in Telerik Pin
Hossein Khalaj4-Oct-12 22:48
MemberHossein Khalaj4-Oct-12 22:48 
Questionbinding: not work property Mode=TwoWay and UpdateSourceTrigger Pin
dominioYP3-Oct-12 0:25
MemberdominioYP3-Oct-12 0:25 
AnswerRe: binding: not work property Mode=TwoWay and UpdateSourceTrigger Pin
Pete O'Hanlon3-Oct-12 0:54
mvaPete O'Hanlon3-Oct-12 0:54 
GeneralRe: binding: not work property Mode=TwoWay and UpdateSourceTrigger Pin
dominioYP3-Oct-12 22:24
MemberdominioYP3-Oct-12 22:24 
QuestionHow do I reference embedded resources in Xaml? Pin
Gil Yoder2-Oct-12 18:57
MemberGil Yoder2-Oct-12 18:57 
I am trying to create a user control in a WPF application that includes a BitmapImage that has been added to the project by including it in Resources.resx. In the xaml editor using VS 2012 I can put the cursor inside the BitmapImage tag, and then reference the properties of the BitmapImage from the editor's properties pane.

In the UriSource dropdown box I can see all of the resources that I have added to the application including those images that are included in Resources.resx, but when I add one of the images and run the program, an exception is raised referencing the line in the xaml where the BitmapImage control is defined.

For example if I start with this:

<BitmapImage x:Key="CameraImage" CreateOptions="IgnoreImageCache" CacheOption="OnLoad" />


And use properties pane to select the image I want from the UriSource field, this attribute is added:

UriSource="pack://siteoforigin:,,,/Resources/Camera32x32.png"


From what I can tell this URI references a file that should be on the drive in the "Resources" directory below the point from which the application runs. If so, I understand why this would produce an error, since that directory does not exist where the application runs (and is not supposed to).

From the documentation I have seen, if a resource is embedded in the local assembly (i.e., the exe file), that the right URI should be something like this:

UriSource="pack://application:,,,/Resources/Camera32x32.png"


where "siteoforigin" is replaced with "application." But that does not seem to work for me either.

The exceptions I see differ depending on different modifications I've made to this attribute's value. The last one referenced gives me a XamlParseException with a message saying, "'Initialization of 'System.Windows.Media.Imaging.BitmapImage' threw an exception," and it had an inner IOException with a message of "Cannot locate resource 'resources/camera32x32.png'." The siteoforigin syntax also throws a XamlParseException, but the inner exception is a DirectoryNotFoundException, and says "Could not find a part of the path."

I have tried several things without luck here, and I've run out of ideas. Can someone help to point me down the right path, and tell me how I can reference an embedded resource from a xaml page?
Gil Yoder
Houston, TX

AnswerRe: How do I reference embedded resources in Xaml? Pin
Gil Yoder4-Oct-12 7:52
MemberGil Yoder4-Oct-12 7:52 
Questionsilverlight Pin
rameshchetu30-Sep-12 9:12
Memberrameshchetu30-Sep-12 9:12 
AnswerRe: silverlight Pin
Pete O'Hanlon30-Sep-12 9:45
mvaPete O'Hanlon30-Sep-12 9:45 
AnswerRe: silverlight Pin
Kenneth Haugland30-Sep-12 22:36
mvaKenneth Haugland30-Sep-12 22:36 
AnswerRe: silverlight Pin
Abhinav S3-Oct-12 20:40
MemberAbhinav S3-Oct-12 20:40 
QuestionCheckk For WCF Service Running & Exit Pin
Kevin Marois29-Sep-12 9:51
professionalKevin Marois29-Sep-12 9:51 
QuestionSendMessage in C# WPF Pin
dominioYP28-Sep-12 6:11
MemberdominioYP28-Sep-12 6:11 
AnswerRe: SendMessage in C# WPF Pin
Pete O'Hanlon29-Sep-12 10:30
mvaPete O'Hanlon29-Sep-12 10:30 
GeneralRe: SendMessage in C# WPF Pin
dominioYP29-Sep-12 12:08
MemberdominioYP29-Sep-12 12:08 
GeneralRe: SendMessage in C# WPF Pin
Pete O'Hanlon29-Sep-12 20:45
mvaPete O'Hanlon29-Sep-12 20:45 
QuestionNew to .net/ previous programming background Pin
goawayxxxx27-Sep-12 8:29
Membergoawayxxxx27-Sep-12 8:29 
AnswerRe: New to .net/ previous programming background Pin
Richard MacCutchan27-Sep-12 9:47
mveRichard MacCutchan27-Sep-12 9:47 
GeneralRe: New to .net/ previous programming background Pin
goawayxxxx27-Sep-12 10:00
Membergoawayxxxx27-Sep-12 10:00 
GeneralRe: New to .net/ previous programming background Pin
Richard MacCutchan27-Sep-12 21:16
mveRichard MacCutchan27-Sep-12 21:16 
GeneralRe: New to .net/ previous programming background Pin
goawayxxxx28-Sep-12 8:14
Membergoawayxxxx28-Sep-12 8:14 
GeneralRe: New to .net/ previous programming background Pin
Richard MacCutchan28-Sep-12 21:57
mveRichard MacCutchan28-Sep-12 21:57 
GeneralRe: New to .net/ previous programming background Pin
goawayxxxx29-Sep-12 7:29
Membergoawayxxxx29-Sep-12 7:29 

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.