When we want to declaratively use our custom controls or reference the types we defined in XAML, we should declare the XML namespace to map to the CLR namespace in which the controls and types are defined as the following XAML snippt demonstrates:

<Page x:Class="Test.MainWindow"
         xmlns
="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
         xmlns:x
="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:cc
="clr-namespace:Sheva.Windows.Controls;assembly=AvalonLib"
/>

    Recently, I am heavily engaged with writing a resuable WPF control library, and quite often I need to create some pages to test those controls I create, so ever now and then I have to use the cumbersome syntax like above to declare the XML namespace, personally I don't like the syntax, and I thought Microsoft WPF team should come up with a more elegant way of doing it, and in actuality, they did introduce an alternative to do it since the CTP releases. there is a custom attribute called XmlnsDefinitionAttribute in the System.Windows.Markup namespace which allows you to apply to the assembly which contains the types and controls the XAML code would reference.the built-in WPF assemblies such as WindowsBase.dll, PresentationCore.dll, and PresentationFramework.dll all have this attribute applied, and all have http://schemas.microsoft.com/winfx/2006/xaml/presentation namespace mapped with the CLR namespaces introduced by them. and of cause you can use this attribute in your own project, just open the AssemblyInfo.cs file, and append the following directive:

[assembly: XmlnsDefinition("http://schemas.sheva.com/wpf/", "Sheva.Windows.Controls")]

    Then you can declare the namespace alias in XAML this way:

<Page x:Class="Test.MainWindow"
         xmlns
="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
         xmlns:x
="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:cc
="http://schemas.sheva.com/wpf/"
/>
   
    Wow, this is a bit like the built-in xmlns declaration indeed, really really cool indeed:)
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/11/25 12:15 2009/11/25 12:15
Posted by 나는산.
TAGS

Leave your greetings here.

[로그인][오픈아이디란?]
public enum SampleEnum
{
Dog,
Cat,
Scrat,
Hefalump
}

<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:WpfApplication1"
Title="Bind to Enum" Height="250" Width="250">
<Window.Resources>
<ObjectDataProvider x:Key="dataFromEnum"
MethodName="GetValues" ObjectType="{x:Type System:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="local:SampleEnum"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</Window.Resources>
<Grid>
<ListView ItemsSource="{Binding Source={StaticResource dataFromEnum}}"
Margin="10,10,10,0" Height="80" VerticalAlignment="Top" />
<ComboBox ItemsSource="{Binding Source={StaticResource dataFromEnum}}"
Margin="10,0,10,80" Height="25" VerticalAlignment="Bottom" />
</Grid>
</Window>
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/11/24 16:49 2009/11/24 16:49
Posted by 나는산.

Leave your greetings here.

[로그인][오픈아이디란?]
웹브라우저

Firefox (http://www.mozilla.or.kr/ko/)


이메일 클라이언트

Thunderbird (http://www.mozilla.or.kr/ko/thunderbird/)


FTP 클라이언트

FileZilla (http://filezilla-project.org/index.php)


안티스파이웨어

SuperAntiSpyware (http://www.superantispyware.com/)


방화벽

Comodo Firewall (http://www.personalfirewall.comodo.com/)


파일 복사

TeraCopy (http://www.codesector.com/index.php)

=> 대용량 파일 이동/복사 프로그램이다. 파워 유저는 모르면 간첩이라고 한다.


프로그램 삭제

Revo Uninstaller (http://www.revouninstaller.com/)

=> 언인스톨 프로그램


프로세스 관리

Process Explorer (http://technet.microsoft.com/en-us/sysi ··· 653.aspx)


CD/DVD 버너

Ashampoo Burning Studio Free (http://www.download.com/ashampoo-burnin ··· 287.html)


이미지 편집

The GIMP (http://gimp.kr/)

포토스케이프 (http://photoscape.co.kr/ps/main/index.php)


벡터 그래픽

Inkscape (http://www.inkscape.org/)


화면 캡쳐

PickPick (http://picpick.wiziple.net/)


음악 재생 & 관리

Teen Spirit (http://teenspirit.artificialspirit.com/)

Foobar2000 (http://www.foobar2000.org/)


MP3 태그 에디터

TagScanner (http://www.xdlab.ru/en/index.htm)


오디오 편집

Audacity (http://audacity.sourceforge.net/)


CD 리퍼

Exact Audio Copy (http://www.exactaudiocopy.de/)


미디어 플레이어

KMPlayer (http://www.kmplayer.com/korea/index.php)

VLC (http://www.videolan.org/)

Media Player Classic (http://sourceforge.net/projects/guliverkli2/)


원격 액세스 & 관리

TeamViewer (http://www.teamviewer.com/download/index.aspx)

UltraVNC (http://www.uvnc.com/)


다운로드 매니저

Gigaget (http://www.gigaget.com/)

File Download Manager (http://www.freedownloadmanager.org/)


토렌토 클라이언트

uTorrent (http://www.utorrent.com/)


오피스

OpenOffice.org (http://ko.openoffice.org/)


워드 프로세서

Jarte (http://www.jarte.com/)


텍스트 편집

Notepad++ (http://notepad-plus.sourceforge.net/uk/site.htm)

=> 메모장을 대신 하는 프로그램이다. 윈도우 메모장도 좋지만 조금 기능이 부족하다고 느껴졌을 때 부터 사용함.


PDF 리더

PDF-Exchange Viewer (http://www.docu-track.com/home/prod_use ··· x_viewer)

=> PDF 보기 프로그램. 예전에는 Foxit Reader를 사용했는데, 역시 광고 때문에 넘어왔다.


PDF 파일 만들기

Bullzip PDF Printer (http://www.bullzip.com/)


매크로

AutoHotKey (http://www.autohotkey.com/)


클립보드 확장

ArsClip (http://www.joejoesoft.com/cms/showpage.php?cid=97)


기타

7Zip (http://www.7-zip.org/)

=> 32비트/64비트 운영체제를 지원하는 압축 프로그램이다. 요즘 많은 분들이 알집을 사용하는데, 버그도 많을 뿐더러 64비트 지원도 미약하다. 게다가 광고도 싫고 해서 사용함.


Virtual Clone Drive (http://www.slysoft.com/en/virtual-clonedrive.html)

=> 가상 시디 드라이브 프로그램. 원래 데몬을 이용했었는데 광고도 많아지고, 윈도우 7 호환성 문제도 있어서 이 프로그램으로 넘어왔다.

WinMerge (http://winmerge.org/)

=> 텍스트 문서 비교

Honyview3 (http://www.kippler.com/win/honeyview3/)

=> 만화책 보기 프로그램


MyDefrag (http://www.mydefrag.com/Manual-DownloadAndInstall.html)

==> 64비트 지원되는 하드 정리 프로그램


NetWorx (http://www.softperfect.com/products/networx/)

==> 네트워크 사용량 측정기




크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2009/11/07 00:47 2009/11/07 00:47
Posted by 나는산.

Leave your greetings here.

[로그인][오픈아이디란?]
« Previous : 1 : 2 : 3 : 4 : 5 : 6 : 7 : 8 : ... 184 : Next »