블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2737)
Unity3D (817)
Programming (474)
Python (8)
TinyXML (5)
STL (13)
D3D (3)
MFC (1)
C/C++ (54)
C++/CLI (45)
C# (250)
WinForm (6)
WPF (5)
Math (10)
A.I. (1)
Win32API (11)
Algorithm (3)
Design Pattern (7)
UML (1)
MaxScript (1)
FMOD (4)
FX Studio (1)
Lua (2)
Terrain (1)
Shader (3)
boost (2)
Xml (2)
JSON (4)
Etc (11)
Monad (1)
Html5 (4)
Qt (1)
Houdini (0)
Regex (10)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (58)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (53)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
04-25 09:56

WPF 속성은 왜이럴까..


창 크기 고정하기 위해서 옵션을 찾아봤지만 별달리 C# 비슷한게 안보여서..


최소/최대 크기를 같게 해줘보니 고정된다..;;





아직은 WPF 초보라..


우선 되는 방법으로 해놔야지..


나중에 다른 좋은방법 찾으면 바꿔야겠다.



[추가]

지나가는 나그네      

xaml 코드에서 ResizeMode="NoResize" 를 추가하시면 간단하게 됩니다.


반응형
Posted by blueasa
, |




WPF로 이리저리 만들고 이벤트를 추가하려고 C#에서 하듯이 '속성-이벤트' 에서 더블클릭을 했는데,


위 창과같은 팝업창이 뜨면서 이벤트 생성이 실패 했다고 떴다.


처음 보는 황당한 에러에 좀 당황하다가..


자세히 읽어보니 [파일의 첫 번째 클래스여야 합니다.] 라는 글귀가 눈에 들어왔다.


간단히 만들어본다고 한 파일에 클래스를 여러개 넣으면서


버릇대로 메인 클래스에 들어갈 클래스를 메인 클래스의 위에 넣었더니 저런 에러가 떠버렸다.


그래서 메인 클래스의 아래로 모든 클래스를 옮겼더니 이벤트 생성이 잘 된다.


WPF는 이런것도 신경 써야되는구나..


(C#도 같은 에러가 나는데 내가 못겪은걸까..? 나중에 테스트 해봐야지..)

반응형

'Programming > WPF' 카테고리의 다른 글

창크기 고정(조절 막기)  (2) 2012.05.22
DispatcherTimer in WPF  (0) 2012.05.21
using 추가해야 될 것 들..  (0) 2012.05.21
WPF 강좌 링크  (0) 2012.03.07
Posted by blueasa
, |

When you want to set a timer working with GUI, you always come across threading problem. In such scenario, .Net indeed makes programmers life easier. It only matters that you choose the right timer to use.


In Win Form, you need to use System.Windows.Forms.Timer.


In WPF, the one is System.Windows.Threading.DispatcherTimer.


Here is a simple sample code for DispatcherTimer.


{

DispatcherTimer timer = new DispatcherTimer();

timer.Interval = TimeSpan.FromMilliseconds(someInterval);

timer.Tick += new EventHandler(someEventHandler);

timer.Start();

}


{

private void someEventHandler(Object sender, EventArgs args)

{

some operations

//if you want this event handler executed for just once

// DispatcherTimer thisTimer = (DispatcherTimer)sender;

// thisTimer.Stop();

}


P.S.


For general purpose, you can use System.Threading.Timer.


For server-based purpose, System.Timers.Timer can be the right choice.



출처 : http://wangmo.wordpress.com/2007/09/07/dispatchertimer-in-wpf/

반응형
Posted by blueasa
, |

WPF가 C#이랑은 참조하는 게 약간 달라서 적어놔야겠다.


간단하게 리스트로 계속 추가해 나가야겠음.


- DllImport

using System.Runtime.InteropServices;


- ArrayList

using System.Collections;


- DispatcherTimer

using System.Windows.Threading;

반응형
Posted by blueasa
, |

WPF 강좌 링크

Programming/WPF / 2012. 3. 7. 01:44
배워 보세~

링크 :   http://dotnetmvp.tistory.com/22
반응형
Posted by blueasa
, |