2014-10-17 3 views

답변

1

이 솔루션은 의외로 간단하다 :

ResourceDictionary.xaml

<ResourceDictionary x:Class="My.Namespace" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> 

    <Button x:Key="myButtonName" /> 

</ResourceDictionary> 

ResourceDictionary.xaml.cs :

// Example with a button control 
Button myButton= this["myButtonName"] as Button; 

if(myButton != null) 
{ 
// Do something 
} 
+0

위대한 발견! 행복한 코딩 :) – pushpraj

+0

같은 분 내에 질문하셨습니까? 질문을 게시하기 전에 답변을 입력해야합니다. –

관련 문제