티스토리 뷰

반응형

1. GetFocusedElement

Windows.UI.Xaml.Input.FocusManager.GetFocusedElement()

현재 화면에서 포커스를 받고 있는 엘리 먼트를 반환 한다.

 

2. Window.Current.Content

Windows.UI.Xaml.Window.Current.Content

여러가지 활용이 가능

 

Frame인 경우

var frame = Frame ?? Windows.UI.Xaml.Window.Current.Content as Windows.UI.Xaml.Controls.Frame;

var page = (Windows.UI.Xaml.Controls.Page)frame.Content;

현재 페이지를 알 수 있음

 

var result = frame .Navigate(navigationType, navigationParameter);

페이지 네비게이션을 시킬 수 있음

 

3. Window.Current.Bounds

Windows.UI.Xaml.Window.Current.Bounds;

현재 윈도우의 크기, 해상도를 알 수 있음

 

4. GetRuntimeProperty

오브젝트에서 특정 프로퍼티 값 축출

public T GetPropertyValue<T>(object source, string propertyName)
{
    T returnValue = default(T);
    var pinfo = source.GetType().GetRuntimeProperty(propertyName);
    if (pinfo != null)
    {
        object[] indexArgs = {};
        var result = pinfo.GetValue(source);
        if (result != null)
        {
            returnValue = (T)result;
        }
    }
    return returnValue;
}

 

 

반응형
댓글