Click here to Skip to main content
15,888,579 members
Home / Discussions / C#
   

C#

 
QuestionHello how to display images with the title from a file (in ListVeiw C #)? helpe please Pin
Member 1249073930-Apr-16 7:21
Member 1249073930-Apr-16 7:21 
QuestionRe: Hello how to display images with the title from a file (in ListVeiw C #)? helpe please Pin
Richard MacCutchan30-Apr-16 20:47
mveRichard MacCutchan30-Apr-16 20:47 
AnswerRe: Hello how to display images with the title from a file (in ListVeiw C #)? helpe please Pin
OriginalGriff30-Apr-16 20:51
mveOriginalGriff30-Apr-16 20:51 
QuestionUse report Wizard or FastReport to generate report from outcome Pin
wilcoten29-Apr-16 9:29
wilcoten29-Apr-16 9:29 
QuestionGet Instance Of Class By Name Pin
Kevin Marois29-Apr-16 7:50
professionalKevin Marois29-Apr-16 7:50 
AnswerRe: Get Instance Of Class By Name Pin
Gerry Schmitz29-Apr-16 13:02
mveGerry Schmitz29-Apr-16 13:02 
AnswerRe: Get Instance Of Class By Name Pin
Afzaal Ahmad Zeeshan30-Apr-16 10:08
professionalAfzaal Ahmad Zeeshan30-Apr-16 10:08 
AnswerRe: Get Instance Of Class By Name Pin
Richard Deeming4-May-16 2:08
mveRichard Deeming4-May-16 2:08 
This sounds like something that would be better as a Markup Extension[^]. The ProvideValue method[^] will be passed an IServiceProvider instance, from which you can obtain an IXamlTypeResolver[^] instance which you can use to resolve types in exactly the same way as the rest of WPF - it will even work at design-time.

If you need to support generic types, it gets a bit more complicated because of changes made in .NET 4.0; you have to use a combination of IXamlNamespaceResolver and IXamlSchemaContextProvider to resolve the type:
C#
var resolver = GetRequiredService<IXamlNamespaceResolver>(serviceProvider);
var schema = GetRequiredService<IXamlSchemaContextProvider>(serviceProvider);

var xamlNs = resolver.GetNamespace(namespaceName);
string genericTypeName = string.Format(CultureInfo.InvariantCulture, "{0}`{1:D}", typeName, typeArguments.Length);

var xamlTypeName = new XamlTypeName(xamlNs, genericTypeName);
Type genericType = schema.SchemaContext.GetXamlType(xamlTypeName).UnderlyingType;

Type finalType = genericType.MakeGenericType(typeArguments);

Markup Extension for Generic Classes[^]



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


QuestionHelp please, I have a error in this script, when I follow the suggestion their are more errors Pin
wilcoten29-Apr-16 3:51
wilcoten29-Apr-16 3:51 
AnswerRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
OriginalGriff29-Apr-16 3:57
mveOriginalGriff29-Apr-16 3:57 
AnswerRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
ZurdoDev29-Apr-16 4:35
professionalZurdoDev29-Apr-16 4:35 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
wilcoten29-Apr-16 6:10
wilcoten29-Apr-16 6:10 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
OriginalGriff29-Apr-16 6:20
mveOriginalGriff29-Apr-16 6:20 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
wilcoten29-Apr-16 20:36
wilcoten29-Apr-16 20:36 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
OriginalGriff29-Apr-16 21:15
mveOriginalGriff29-Apr-16 21:15 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
wilcoten29-Apr-16 23:17
wilcoten29-Apr-16 23:17 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
OriginalGriff29-Apr-16 23:50
mveOriginalGriff29-Apr-16 23:50 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
wilcoten30-Apr-16 4:05
wilcoten30-Apr-16 4:05 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
OriginalGriff30-Apr-16 4:30
mveOriginalGriff30-Apr-16 4:30 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
wilcoten30-Apr-16 4:46
wilcoten30-Apr-16 4:46 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
OriginalGriff30-Apr-16 5:06
mveOriginalGriff30-Apr-16 5:06 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
wilcoten30-Apr-16 5:37
wilcoten30-Apr-16 5:37 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
OriginalGriff30-Apr-16 5:59
mveOriginalGriff30-Apr-16 5:59 
AnswerRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
ZurdoDev29-Apr-16 6:32
professionalZurdoDev29-Apr-16 6:32 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
wilcoten29-Apr-16 8:33
wilcoten29-Apr-16 8:33 

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.