■ ButtonEdit 클래스 : 커스텀 버튼 생성하기

----------------------------------------------------------------------------------------------------

using System;

using System.Windows.Controls;

using System.Windows.Media.Imaging;

 

using DevExpress.Xpf.Editors;

 

#region 커스텀 버튼 생성하기 - CreateCustomButton(buttonEdit, imageURI)

 

/// <summary>

/// 커스텀 버튼 생성하기

/// </summary>

/// <param name="buttonEdit">ButtonEdit 객체</param>

/// <param name="imageURI">이미지 URI</param>

/// <returns>ButtonInfo 객체</returns>

private ButtonInfo CreateCustomButton(ButtonEdit buttonEdit, Uri imageURI)

{

    BitmapImage bitmapImage = new BitmapImage(imageURI);

 

    Image image = new Image() { Source = bitmapImage };

 

    ButtonInfo buttonInfo = new ButtonInfo()

    {

        GlyphKind = GlyphKind.User,

        Content   = pImage,

    };

 

    buttonEdit.Buttons.Add(buttonInfo);

 

    return buttonInfo;

}

 

#endregion

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요