제가 또 일 끝까지 안하고 새로 일 벌리는 걸 좋아하죠. (…후우…)

MSDN POPCON에 ‘공도의 실버라이트 하기 좋은 날’이란 동영상 시리즈를 연재하기로 했어요. 매주 목요일날 업데이트 예정이고요, 내용은 그야말로 자유. 피드백 많이 주세요 :D

그 대망의 시리즈 제 1편: http://blogs.msdn.com/popcon/archive/2009/07/02/s-1.aspx

소개가 참 간드러지게 나왔는데요, 제가 원래 그 모양이니 모…ㅎㅎ

아래는 기각당한 초안이에요. 사실 이쪽이 더 마음에 들어서 남겨놉니다.^^

한 몇 개월 전부터 실버라이튼지 뭔지 하는 게 자꾸 사람들이 얘기는 하는데,
그까이꺼 대애애~충 훑어보니 뭐 별 어려워 보이는 것도 없고 해서 한 번 해 보는데,
팀장님이 '너 뭐하냐?' 물어보니 나름 깝쭉대 보지만?
아뿔사! 이건 뭐 내가 뭘 하는 지 설명을 못하겠네...
하는 당신을 위한 초고농도압축액기스추출 동영상!
액기스만 모았습니다. 짧습니다. 효과 (아마도)확실합니다!
(※부작용 발생 시 가까운 개발자나 디자이너에게 하소연하시기 바랍니다.)

P.S. 
손발은 오글오글.

저작자 표시 동일 조건 변경 허락
Posted by gongdo

Submit comment.

  1. BlogIcon othniel 2009/07/02 14:50  comment URL  Edit/Remove  Submit comment.

    제목이 너무 좋네요 실버라이트 하기 좋은날 (오늘 천둥번개 동반) ~ ㅎ
    공도님 대단하세요 ^^

    • BlogIcon Gongdo 2009/07/02 16:53  comment URL  Modify/Remove

      사실은 제목 줄임말이 별로 좋지 않아서 고민하다가 딱히 떠오르는게 없어서 이걸로 했어요.
      부드러운 줄임말이 대센데 말이죠.
      공실날? 공실좋? 실하날? 어떡게 줄여도 마음에 안드네요. 좋은 아이디어 있으면 주세요^^

흔히 마이크로소프트에서 배포하는 설치파일은 무인설치(Unattended installation) 라고 해서 설치 화면을 보여주지 않고 설치할 수 있는 옵션을 제공하죠.

실버라이트 설치 파일도 마찬가지에요. 방법은 아주 심플. 커맨드 프롬프트에서 실버라이트 설치 파일이 있는 디렉터리로 이동한 후 다음 커맨드를 입력하면 돼요.

  • 설치
    Silverlight.3.0.exe -q
  • 제거
    Silverlight.3.0.exe –qu

참 쉽죠? :p

참고로 당연하겠지만 윈도 비스타 이상에서는 삭제나 설치할 때 UAC가 뜨게 되죠.

어디다 쓰냐고요? 물론 웹으로만 배포할 경우에는 별로 쓸모 없겠지만 엔터프라이즈 솔루션의 경우 실버라이트 애플리케이션이 솔루션의 일부로 포함될 수도 있겠죠. 이럴 때 한꺼번에 배포한다면 편리할 거에요.

저작자 표시 동일 조건 변경 허락
Posted by gongdo

Submit comment.

I posted how to use DataBinding with Behaviors in Silverlight 3 recently. However, it turns out, it's impossible or very limitted.

Follow code is what I expected to work.

<Grid x:Name="LayoutRoot" Background="White">
    <Button Content="Test" HorizontalAlignment="Right">
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="Click">
                <hi:ShowMessageBoxAction x:Name="Action1"/>
            </i:EventTrigger>
        </i:Interaction.Triggers

        <i:Interaction.Behaviors>
            <hi:BindingProxyBehavior
                        TargetName="Action1"
                        TargetPropertyName="Message"
                        Binding="{Binding Path=MockString}" />
        </i:Interaction.Behaviors>
    </Button>
</Grid>

[It doesn't work, 'cause Behaviors are not FrameworkElements]

- ShowMessageBoxAction which named "Action1" by x:Name attribute has a property named Message.
- BindingProxyBehavior is a Behavior. And it figures out "Action1" by AssociatedObject(LayoutRoot).FindName method when it has been invoked.

But It's impossible, 'cause Behaviors are not Frameworks so they can't be found by FrameworkElement.FindName method.

It's OK, I can understand why is it impossible. However how do you think about code follow:

<DataTemplate x:Key="DataTemplate1">
    <Grid>
        <Button HorizontalAlignment="Left" Content="{Binding Mode=OneWay, Path=Title}">
            <i:Interaction.Triggers>
                <i:EventTrigger x:Name="Trriger1" EventName="Click">
                    <hi:ShowMessageBoxAction x:Name="ShowMessageAction"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>           

            <i:Interaction.Behaviors>
                <hi:BindingProxyBehavior
                    TargetName="ShowMessageAction"
                    TargetPropertyName="Message"
                    Binding="{Binding Path=Description}" />
            </i:Interaction.Behaviors>
        </Button>
    </Grid>
</DataTemplate>

[Does it work or not?]

It's similar to first one, except root Grid is in the DataTemplate.
Guess what? it works. Very well.
HOW COME!? Isn't it wierd?

Now I have to give up to do DataBinding with Behaviors in Silverlight 3 by that way.
It makes me depressed. "No binding, more work".
Anyway all I really want to ask Microsoft is, just allow us DataBinding with Behaviors, so we can create application rapidly, design-friendly, and even elegantly! Like follow code:

<Grid x:Name="LayoutRoot">
    <Button Content="Test">
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="Click">
                <hi:ShowMessageBoxAction
                    x:Name="Action1"
                    Message="{Binding Path=Description}" />
            </i:EventTrigger>
        </i:Interaction.Triggers>
    </Button>
</Grid>

[Elegant DataBinding with Behaviors]

Here for sample project:

저작자 표시 동일 조건 변경 허락
Posted by gongdo

Submit comment.