Autor Beitrag
miniC#
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 75

Wiin XP Home
C# VS Express 2008
BeitragVerfasst: So 18.01.09 13:21 
Hallo,

mir dünkt es, dass die Frage schon Xmal gestellt wurde, aber ich bin scheinbar zu doof zum Suchen. Ich möchte eine Control.Style in codebehind auf ein im Projekt vorhandendes Ressourcenwörterbuch festlegen. MDSN schweigt sich leider zu dem Thema aus (zumindest unter der Styleeigenschaft).

user defined image

wie lege ich nun class1.Style auf test.xaml fest ? mein grundproblem ist auch , dass ich nicht weis, wie ich überhaupt an das wörterbuch herankomme codebehind. mein wunschcode wäre quasi :

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
public class class1 : Button
public class1()
{
   base.Style = test.xaml;
}


vielen dank für eure antworten im vorraus, gruß,
miniC#

_________________
Zitat MDSN : " ... C# (gesprochen: "si scharp") " :D
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: So 18.01.09 15:17 
Hört sich ganz nach einem Custom Control (auf deutsch afair "benutzerdefiniertes Steuerelement") an. Wenn du dir das von VS anlegen lässt, wird der Style in generic.xaml automatisch auf dein Control angewendet.

_________________
>λ=
miniC# Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 75

Wiin XP Home
C# VS Express 2008
BeitragVerfasst: Mo 19.01.09 13:09 
danke, war genau das, was ich gesucht hatte.

_________________
Zitat MDSN : " ... C# (gesprochen: "si scharp") " :D