'분류 전체보기'에 해당되는 글 744건

  1. 2010.10.08 [wp7] viewbox
  2. 2010.10.07 [wp7] behind에서 application bar 만들기
  3. 2010.10.05 [wp7] Enum 정리
  4. 2010.10.05 [wp7] 나중에 공부할것 Deployment의 Dispatcher
  5. 2010.10.04 [wp7] 기본 키패드(Number)에 . 키만 가능하게 만들기
  6. 2010.10.01 white (화이트) -mocca
  7. 2010.09.30 [wp7] UserControl에 간략하게 Dependency Property 쓰는법
  8. 2010.09.28 [wp7] childrun add한 UserControl 안에서 remove하기
  9. 2010.09.27 [wp7] Regex를 이용해서 숫자 형식을 바꾸어보자.(정규표현식)
  10. 2010.09.17 [wp7] 엔터키를 눌렀을때 키패드 사라지게 하기
  11. 2010.09.13 몽키3 결제 했는데 꼭 해지하자. 적어도 11월 10일 1
  12. 2010.09.09 [wp7] DLL 레퍼런스 추가 할때 지정된 경로에?
  13. 2010.09.07 [wp7] Behind코드에서 폰트바꾸기
  14. 2010.09.07 아이폰 받았을시 확인해봐야할것
  15. 2010.09.07 [wp7] Month 입력 국제화 하기
  16. 2010.08.17 아이폰4 예약 하기
  17. 2010.08.16 [wp7] 같은 데이터 비교했지만 메모리저장 위치가 달라서 틀리다고 나올때
  18. 2010.08.13 [wp7] 윈폰에서 전화가 울리거나 검색에 갔을때 저장? 1
  19. 2010.08.09 [wp7] Navigate를 Page Control 이외에서 하기
  20. 2010.07.26 [wp7] 리소스 파일 적용하기 (지역화) 2
  21. 2010.07.23 Mocca - The Best Thing
  22. 2010.07.23 Miss A Bad Girl Good Girl
  23. 2010.07.15 달콤한 노래 모음
  24. 2010.07.15 이지혜 -곰돌이
  25. 2010.07.13 [wp7] Windows 7 Phone SDK Beta 릴리즈 1
  26. 2010.07.09 [wp7] 유동적인 Button 에서 Template 입히기
  27. 2010.07.07 [wp7] 다른 프로젝트에 있는 페이지로 Navigate 하기
  28. 2010.06.29 [wp7] CommandPattern DataList의 Item Templete 안의 Button 이벤트 빼기
  29. 2010.06.28 [wp7] StartWith의 편리함 String내에서 자동완성 기능 할때 좋음.
  30. 2010.06.24 [util] utralmon 3.0.10
Windows Phone 72010. 10. 8. 22:03


윈폰의 viewbox가 없어서 남이 만들어논걸 쓴다 ㅋㅋ

http://blogs.imeta.co.uk/nrees/archive/2010/06/29/viewbox-wrappanel-and-a-scalable-ui-for-windows-phone-7.aspx


링크로 대신하자.;;

Posted by 동동(이재동)
Windows Phone 72010. 10. 7. 17:09

private void CreateApplicationBar()
{
    ApplicationBar = new ApplicationBar();
    ApplicationBar.IsVisible = true;
    ApplicationBar.IsMenuEnabled = false;
 
    ApplicationBarIconButton apDoneButton = new ApplicationBarIconButton(new Uri("icons/appbar.check.rest.png", UriKind.Relative));
    apDoneButton.Text = "Done";
    apDoneButton.Click += new EventHandler(apDoneButton_Click);
 
    ApplicationBarIconButton apCancelButton = new ApplicationBarIconButton(new Uri("icons/appbar.cancel.rest.png", UriKind.Relative));
    apCancelButton.Text = "Cancel";
    apCancelButton.Click += new EventHandler(apCancelButton_Click);
 
    ApplicationBar.Buttons.Add(apDoneButton);
    ApplicationBar.Buttons.Add(apCancelButton);
 
}

 

시간이 없으므로 소스로 대신한다.

Posted by 동동(이재동)
Windows Phone 72010. 10. 5. 14:49
/// <summary>
/// SNS Type 정의
/// </summary>
   public enum SnsType
   {
       Facebook,
       Twitter,
   };

 

 

이렇게 쓰는방법이랑

 

뒤에 facebook 에 정의를 쓰는방법이 있다.

 

만약 현재 string을 enum 형식으로 변환하고 싶으면 이렇게 하면 되고

YourEnum foo = (YourEnum) Enum.Parse(typeof(YourEnum), yourString);

만약 이렇게 int형식으로 바꾸고 싶을때는 
 
 public enum RouteTypeName     {         RouteTypeDirect = 1,         RouteTypeTransfer = 2     }

그냥 이렇게 형변환 하면 된다.

(int)ReserveInfoModel.radJobId


Posted by 동동(이재동)
Windows Phone 72010. 10. 5. 14:43
Deployment.Current.Dispatcher.BeginInvoke(delegate()
            {
                var value = Math.Round(e.X, 1) * 100;
                BallTransform.TranslateX = value;
                System.Diagnostics.Debug.WriteLine(value);
            });

 

dispatcher에 대해서 공부하자 나중에

 

그냥 dispatcher와 deployment 의 dispatcher가 어떤게 다른지 알아볼것?

Posted by 동동(이재동)
Windows Phone 72010. 10. 4. 17:21

현제 기본적으로 inputScop를 지원하는 유일한 Numberic 키패드는 TelephoneNumber이다.(머 추후 업데이트 되겠지 )

 

먼저 Number키패드에는 . 만 있는게 아니라 ‘ 라든지 있다.

 

나는 . 만 입력되게 하고 싶었지만 아예 .키가 동작을 하지 않았다… 더 억울한 상황 ㅠ.ㅠ

 

그래서 TextBox 를 상속받아서 override해서 해결하였다.

 

일단 전체 소스를 보자

 

 
using System.Globalization;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using SalePrice.Views;
using System;
 
namespace SalePrice.Controls
{
    public class FormattedTextBox : TextBox
    {
        public enum NumberType
        {
            Number,
            Double,
            Integer,
            Currency
        };
 
        public string FormattedText
        {
            get { return (string)GetValue(FormattedTextProperty); }
            set { SetValue(FormattedTextProperty, value); }
        }
 
        public static readonly DependencyProperty FormattedTextProperty =
            DependencyProperty.Register("FormattedText", typeof(string), typeof(FormattedTextBox), new PropertyMetadata(string.Empty));
 
        public double Number
        {
            get { return (double)GetValue(NumberProperty); }
            set { SetValue(NumberProperty, value); }
        }
 
        public static readonly DependencyProperty NumberProperty =
            DependencyProperty.Register("Number", typeof(double), typeof(FormattedTextBox), new PropertyMetadata(double.NaN, onNumberPropertyChanged));
 
        protected static void onNumberPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            FormattedTextBox ftb = d as FormattedTextBox;
            ftb.onNumberChanged((double)e.OldValue, (double)e.NewValue);
        }
 
        public NumberType Type
        {
            get { return (NumberType)GetValue(TypeProperty); }
            set { SetValue(TypeProperty, value); }
        }
 
        public static readonly DependencyProperty TypeProperty =
            DependencyProperty.Register("Type", typeof(NumberType), typeof(FormattedTextBox), new PropertyMetadata(NumberType.Double, onTypePropertyChanged));
 
        protected static void onTypePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            FormattedTextBox ftb = d as FormattedTextBox;
            ftb.onTypeChanged((NumberType)e.OldValue, (NumberType)e.NewValue);
        }
 
        private Regex _regex = null;
        private string _lastSuccess = string.Empty;
        private int _prevPos = 0;
 
        public FormattedTextBox()
        {
            DefaultStyleKey = typeof(FormattedTextBox);
            TextChanged += onTextChanged;
            InputScope = new InputScope();
            //InputScope.Names.Add(new InputScopeName(){ NameValue= InputScopeNameValue.CurrencyAmount});
            InputScope.Names.Add(new InputScopeName() { NameValue = InputScopeNameValue.TelephoneNumber });
 
        }
 
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            setType(Type);
            updateFormattedText();            
       }
 
        protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
        {
            base.OnManipulationCompleted(e);
            this.Focus();
        }
 
        private void setType(NumberType type)
        {
            switch (type)
            {
                case NumberType.Double:
                case NumberType.Currency:
                    _regex = new Regex(@"^\d+\.?\d*?$");
                    //_regex = new Regex(@"^(((\d{1,3})(,\d{3})*)|(\d+))(.\d+)?$");
                    break;
                case NumberType.Number:
                case NumberType.Integer:
                    _regex = new Regex(@"^\d+$");
                    //_regex = new Regex(@"^\d+$");                    
                    break;
            }
        }
 
        private void updateFormattedText()
        {
            if (string.IsNullOrEmpty(Text) == true || _regex == null)
                return;
 
            if (_regex.Match(Text).Success == false)
            {
                Text = _lastSuccess;
                SelectionStart = _prevPos;
            }
 
            double num = 0;
            double.TryParse(Text, out num);
 
            switch (Type)
            {
                case NumberType.Double:
                    {
                        Number = num;
                        FormattedText = Text;
                    }
                    break;
                case NumberType.Integer:
                    {
                        Number = (int)num;
                        FormattedText = Text;
                    }
                    break;
                case NumberType.Currency:
                    {
                        Number = num;
                        //FormattedText = string.Format("{0:C}", Number);
                        FormattedText = string.Format("{0:N}", Number);
                    }
                    break;
            }            
        }
 
        private void onTextChanged(object sender, TextChangedEventArgs e)
        {
            if (string.IsNullOrEmpty(Text) == true)
            {
                Number = 0;
                SelectAll();
                SelectionStart = 0;
            }
            updateFormattedText();
        }
        
 
        protected virtual void onNumberChanged(double oldValue, double newValue)
        {
            string old = Text;         
            Text = newValue.ToString();
 
            if (Text != old)
            {
                SelectionStart = _prevPos;
            }
        }
 
        protected virtual void onTypeChanged(NumberType oldValue, NumberType newValue)
        {
            setType(newValue);
            updateFormattedText();
        }
 
        protected override void OnGotFocus(RoutedEventArgs e)
        {
            base.OnGotFocus(e);
 
            SelectAll();
            SelectionStart = 0;
        }
 
       
        protected override void OnKeyDown(KeyEventArgs e)
        {            
            _lastSuccess = Text;
            _prevPos = SelectionStart;
           
            switch (e.Key)
            {
                case Key.D0:
                case Key.D1:
                case Key.D2:
                case Key.D3:
                case Key.D4:
                case Key.D5:
                case Key.D6:
                case Key.D7:
                case Key.D8:
                case Key.D9:
                case Key.NumPad0:
                case Key.NumPad1:
                case Key.NumPad2:
                case Key.NumPad3:
                case Key.NumPad4:
                case Key.NumPad5:
                case Key.NumPad6:
                case Key.NumPad7:
                case Key.NumPad8:
                case Key.NumPad9:
                case Key.Decimal:
                case Key.Delete:
                case Key.Back:
                case Key.Left:
                case Key.Right:
                case Key.Enter:                
                case Key.Tab:
                    {
                        base.OnKeyDown(e);
                    }
                    break;
                default:
                    {
                        //"."키의 keycode로 구분해서 사용 가능하게 만든다.
                        if (e.PlatformKeyCode == 190)
                        {
                            base.OnKeyDown(e);
                        }
                        else
                        {
                            e.Handled = true;
                        }                        
                    }
                    break;
            }
        }
    }
}
 


key 다운에 보면 주석으로 달아놓았다 ㅋㅋ

Posted by 동동(이재동)
노래2010. 10. 1. 11:31


Following Genie from a bottle


Together searching for the castle of OZ

Riding the dream of adventures crossing the rainbow



램프의 요정을 따라서 오즈의 성을 찾아 나서는 모험의 꿈을 타고 무지개를 건너



Magical power of mistery, the power a veiled witch was longing for

Let them free this speel-bound people lock, little girl



베일에 쌓인 마녀조차 얻지 못한 신비한 힘으로 마법에 묶인 사람들을 자유롭게 해



"Why don't you make your dreams come ture When you were younger and you thought all things were possible?"
"Of course. I was naive. Now i'm old."
"Why do you feel that way? Whenever you feel, make a wish for your dreams come true."
"Yes, way to go!"



Raise your hands up Peter Pan and Wendy, once you cannot fly up high
Only full of happy memories in our heart



날지 못하는 피터팬 웬디 두팔을 하늘 높이 마음엔 행복한 순간만이 가득


Oh! ideal taste of enjoyment


Imagine fairy's worㅣd up in the sky once we poen up the gate
We'll make it happen and achieve everything we've been dreaming of



저 구름 위로 동화의 나라 닫힌 성문을 열면 간절한 소망의 힘 그 하나로 다 이룰 수 있어



Where the woods are veiled in the darkness
And where an is island's breathing with magic
Let's have a dream of a fantastic future for us



짙게 드리운 안개 숲도, 주문으로 숨쉬는 섬에도 아름다운 미래의 꿈 펼쳐지게 해



"Have you ever heard of the story about the black hearted prince and the wicked Cinderella?"
"No, I haven't it is a story a can't even imagine or believe."
"Why can't you believe it could be ture?"
"Just maybe it is story of you and I."


Throw everything you don't want to know high up in the ocean sky
Only full of happy memoryse in our heart



알고 싶지 않은 것 모두 다 저 넓은 하늘 높이 마음엔 행복한 순간만이 가득


Oh, ideal taste of enjoyment!



Imagine fairy's world up in the sky once we open up the gate.
We'll make it happen and achieve everything we've been dreaming of



저 구름위로 동화의 나라 닫힌 성문을 열면 간절한 소망의 힘 그 하나로 다 이룰 수 있어


Throw everything you don't want to know high up in the ocean sky
Only full of happy memoryse in our heart



알고 싶지 않은 것 모두 다 저 넓은 하늘 높이 마음엔 행복한 순간만이 가득


Oh, ideal taste of enjoyment!



Imagine fairy's world up in the sky once we open up the gate.
We'll make it happen and achieve everything we've been dreaming of It's in your heart



저 구름 위로 동화의 나라 닫힌 성문을 열면 간절한 소망의 힘 그 하나로 다 이룰 수 있어 너의 마음속에

'노래' 카테고리의 다른 글

Mocca - The Best Thing  (0) 2010.07.23
Miss A Bad Girl Good Girl  (0) 2010.07.23
달콤한 노래 모음  (0) 2010.07.15
이지혜 -곰돌이  (0) 2010.07.15
[가사] 커플 - 김용준  (0) 2009.08.05
Posted by 동동(이재동)
Windows Phone 72010. 9. 30. 17:52

먼저 UserControl을 이용하여 Dependecy Property를 쓴 간략한 예제를 먼저 보자

<UserControl x:Class="WorldHoliday.Views.HolidayText"
 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 
    mc:Ignorable="d"
 
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
 
    FontSize="{StaticResource PhoneFontSizeNormal}"
 
    Foreground="{StaticResource PhoneForegroundBrush}"
 
    x:Name="RootText"
 
    >    
 
    <StackPanel>
 
        <TextBlock Text="{Binding Path=HolidayTextValue,ElementName=RootText}" VerticalAlignment="Center"/>
 
        <Path Data="M0,52 L480.02109,52" Fill="#FFF4F4F5" Height="1" Margin="0,0,-1.021,7" Stretch="Fill" Stroke="White" UseLayoutRounding="False" VerticalAlignment="Bottom"/>
 
    </StackPanel>
 
</UserControl>
 
 

 

그냥 usercontrol에 Textbox 하나 넣은 것이다. 이미 구현된 완성본을 넣었다. 일단 완성 해 놓고 시작을 했다.

 

자 이제 behind코드를 보자.

public partial class HolidayText : UserControl
 
   {
 
       public string HolidayTextValue
 
       {
 
           get { return (string)GetValue(HolidayTextValueProperty); }
 
           set { SetValue(HolidayTextValueProperty, value); }
 
       }
 
 
       public static readonly DependencyProperty HolidayTextValueProperty =
 
          DependencyProperty.Register("HolidayTextValue", typeof(string), typeof(HolidayText), new PropertyMetadata(string.Empty));
 
 
 
 
       public HolidayText()
 
       {
 
           InitializeComponent();            
 
       }
 
   }

 

그냥 간단하게 넣은것이다.

 

약간 설명을 하자면

Name = 등록할 속성의 이름

Propeprty=  속성의 타입

ownerType = 속성을 포함한 부모의 타입

typeMetaData = 속성 메타데이타 지정 (보통 callback 함수를 지정함)

 

마지막은 null로 지정가능하고 필요에 따라서 call back 함수를 만들어서 사용할수도 있다. 자세한 설명은

 

http://drum-83.tistory.com/82

 

여기를 참조 하자

 

자 이제 이 유저컨트롤을 사용한 코드를 보자

 

HolidayText ht = new HolidayText()
 
{
 
    HolidayTextValue = day
 
}; 
 
 
HolidayMonthList.Children.Add(ht);

 

자 이제 이 간단한 코드를 자세히 살펴보자..

 

이건 HolidayText라는 유저 컨트롤에 HolidayTextValue라는 Dependency Property를 정의 하고 그냥 string형 값을

 

주면 usercontrol안의 TextBlock에 내용을 뿌려주는 것이다.

 

중요한 건 저렇게 Dependency Property를 주는데 꼭 ElementName을 줘야 한다는 것이다 중요!!!!

 

<TextBlock Text="{Binding Path=HolidayTextValue,ElementName=RootText}" VerticalAlignment="Center"/>

 

이부분에서 ElementName은 위에 UserControl에 x:Name="RootText" 이렇게 정의 하였다…

 

만약 ElementName을 주지 않는다면 바인딩이 제대로 되지 않으므로 주의 하자

 

참고 : http://decav.com/blogs/andre/archive/2007/05/27/wpf-binding-to-properties-in-your-usercontrol-or-window.aspx <—elementName의 중요성

Posted by 동동(이재동)
Windows Phone 72010. 9. 28. 12:40

제목이 이상하다 이걸 어떻게 표현해야 하는지 모르겠다.

 

예전부터 알고 있었는데 (아마 포스팅 보면 나올듯)

 

쉬운거지만 아마 모를수도 있는사람들을 위해서 써놓자~

 

머 프로젝트에서 패널 을 하나 만들고(나는 그냥 Canvas)

 

 

TwitterLoginUserControl tl = new TwitterLoginUserControl();
ContentGrid.Children.Add(tl);
 
이렇게 add를 하고 만약 이 유저 컨트롤에 Close 버튼을 만들고 remove 를 하고 싶다면 ?
 
그렇다면  가장 쉬운방법이
 
tl.CloseBUtton.Click +=  이벤트 어쩌구 저쩌구 이렇게 만드는게 젤 쉽지만
 
코드가 지저분해진다.. 나는 딱 유저콘트롤에서 해결 하고 싶다 이러면
 
유저콘트롤에서
 
void SubmitButton_Click(object sender, RoutedEventArgs e)
{
var parentCanvas = this.Parent as Canvas;
parentCanvas.Children.Remove(this);
}

 
이렇게 하면 된다.

Posted by 동동(이재동)
Windows Phone 72010. 9. 27. 15:03

일단 regex 를 공부를 해야 하지만…

 

공부가 안되어있다면 regex 라이브러리를 이용해보자.. 하지만 나중에는 공부할것

 

데이터를 추출할때 유용하다.

 

일단 기초 공부는 여기서 시작하고

 

http://golee07.tistory.com/309

 

 

여기에서 regex 라이브러리를 참고하자

http://regexlib.com/DisplayPatterns.aspx?cattabindex=2&categoryId=3

Posted by 동동(이재동)
Windows Phone 72010. 9. 17. 15:46

윈도우7에서 텍스트 박스에 포커스가 가게 되면 키패드가 자동으로 열린다.

 

하지만 입력을 완료하고 텍스트 박스를 닫고 싶지만 닫을려면

 

“Back” 버튼을 누르던가 다른 컨트롤을 터치하여 포커스를 옮겨야만 한다.

 

“Enter”키가 있지만 나가는 버튼은 아니다. 아마 TextBox내에서 엔터 치는 기능인듯?

 

하지만 숫자같은걸 입력하는 즉 짧은 단어를 입력하고 Enter를 누르면 키패드가 닫히게 하고 싶다.

 

정말 간단하다. 하지만 약간 꼼수일수도 있고 깔끔하게 컨트롤로 만드는것도 불가능하다.

 

자 왜 컨트롤로 못 만드는지와 어떻게 하는지 알아보자.

 

일단 해당 텍스트 박스의 KeyDown 이벤트를 받아야 한다.

 

 

TaxTextBox.KeyDown += new KeyEventHandler(TaxTextBox_KeyDown);

받았으면 아래처럼 Enter키를 받고서 focus를 Page에 준다.

 

/// <summary>
/// Enter키를 눌렀을시 focus를 페이지에 주어서 키패드가 사라지게 함
/// </summary>
/// <param name="e"></param>
private void EscapeKeypad(System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
this.Focus();
}
}

그러면 끝~

Posted by 동동(이재동)
iPhone App2010. 9. 13. 18:06

몽키3 결제를 했다...


일단 컴퓨터에서도 노래를 무제한 들을수 있으며 아이폰에는 다운도 가능하기때문이며


또 한달 들으면 한달은 무료란다...


하지만 결제가 자동결제여야만 한달이 무료였다.


지금이 9월 13일이니까 적어도 11월 10일까지는 꼭 해지를 안하면 까먹고 계속 돈 4500원이 나갈것이다.


까먹지 말고 꼭하자...


결제 하고 나니까 피해사례가 떳다.


결제나간다고 말을 안했다는것이다. 피해본사람이 많은듯


http://cafe.naver.com/appleiphone/596498


Posted by 동동(이재동)
Windows Phone 72010. 9. 9. 11:19

DLL 추가할때 조심해야 할것이 있다. 나혼차 사용할때는 상관이 없지만 TFS 나 SVN에서 같이 소스를 공유 할 경우라면

 

dll 경로를 잘맞추어주어서 올려야 한다.

 

오늘 appbox에서 쓰는 dll을 붙여서 해볼려고 했는데 내컴퓨터에서는 잘되는데 딴자리에서는 dll을 참조 할수가 없다고

 

나왔다. 왜 그런가 Dll Path를 확인하였더니 bin/ 뒤에 있는게 아닌가?

 

그래서 별 뻣짓을 다했다.

 

일단 svn에서 받은 컴퓨터에서 프로젝트 속성에서 Reference Path에 폴더를 add하면 잘되긴 하지만 정확한 해결방법이

 

아니다..

 

그렇다면 어떡해야 할까?

 

팀장님이 알려주신 방법으로는 여러가지 방법이 있지만 이렇게 해결하였다.

 

 

image

 

이렇게 폴더를 만들어 dll 파일 자체를 프로젝트에 등록하는 방법이다.

 

이렇게 해서 참조를 한후 svn Checkout을 하면 레퍼런스  Path 오류가 없어진다.

Posted by 동동(이재동)
Windows Phone 72010. 9. 7. 18:24

원래 알지만 헷갈릴수도 있으니 그냥 적는다 ㅋㅋ


FontFamily = new FontFamily("Segoe WP Light")


이렇게 string으로 써야 한다...

Posted by 동동(이재동)
iPhone App2010. 9. 7. 11:24
Posted by 동동(이재동)
Windows Phone 72010. 9. 7. 11:12

일단 폰에서 Month를 표시 하는 어플이 있는데 그냥 Month 라고 해서 “Jan”, “Feb” 이렇게 입력하면 미국에서는 잘보일

 

지 모르나 이탈리아나 프랑스 같이 다르게 쓰는 사람들은 불편할수가 있다. 그러면 어떻게 해야할까?

 

리소스로 뺴야할까? 그렇게 된다면 엄청난 노가다를 해야한다..ㅠ.ㅠ

 

일단 리스트에 모든 달을 넣어보자… 이렇게

 

for (int i = 0; i < Months.Length; i++)
            {
                Months[i] = Thread.CurrentThread.CurrentCulture.DateTimeFormat.AbbreviatedMonthNames[i];
            }
 
너무 쉽나… Thread를 이용하면 된다…
 
근데 이 Month를 Parse해야 할경우가 있다. 날짜 비교라던지 DateTime형으로 만들고 싶을때….
 
이때는 어떻게 해야할까 일단 “Jan”이라는 결과가 있는데 이걸 1로 바꾸고 싶다….
 
parse를 이용하면 되지만 날짜 형식이 일치해야 하기때문에… 강제로 그냥 만들어준다. 이게 좋은 방법인지는
 
나도 잘모르겠다 더 좋은 방법이 있으면 다시 포스팅해야겠다.
 
private int GetMonthToInt(string month)
       {            
           return DateTime.Parse(string.Format("2009/{0}/13", month)).Month;
       }
 
 
Posted by 동동(이재동)
iPhone App2010. 8. 17. 09:26

뜨아 힘들다 ㅋㅋ 내일이 드디어 아이폰4 예약하는 날이다

새벽 5시에 일어나서 준비를 해야 한다 광클을... 6시에 예약하니까 근데 기차표도 예약 하는날이 겹쳐서 ㅋㅋ

일단 미리 대리점 위치를 검색해 놨다... 우리집 위치랑 이런것도 미리 준비해야겠다.

메모장에 바로 기입할수 있도록 (복사 & 붙여넣기) 주소랑 전화번호 통장 번호 등등을 미리 써놔야겠다.

미리 적어야할  양식폼 샘플

http://db.blueweb.co.kr/formmail/Newformmail.html?dataname=ranger2xx0

우리집에서 가까운 대리점 리스트~

그리고  브라우저 크기는 100%로 만들어 놓고 팝업창 허용으로 바꿀껏


주식회사케이픽 퍼스트 신림정 1577-3940 서울 관악구 신림동 1640-44번지 <--젤가까움

팝세븐 서울 관악구 신림동 1422-10번지

새벽 텔레콤 서울관악구 신림동 1641-50번지


일단 가까운 리스트를 뽑아 놓았다...

이제 광클많이 살길이다 오늘은 일찍 자야겠다 ㅋㅋ

아이폰4 가 손에 들어온다~

Posted by 동동(이재동)
Windows Phone 72010. 8. 16. 11:03

팀장님이 알려주신거다.. 아 역시 아직 배워야 할께 많다…

 

어떤 데이터를 비교 해야하는데(Class Type) 종료하기전에 isolatedStroage에 해당 데이터를 저장하고

 

다시 불러들일때 isolatedStroage에 있는 데이터는 같지만 메모리의 저장위치가 달라서 비교했을때

 

False로 나온다. 이때는 어떡해야 할까? foreach문으로 해당 문을 하나씩 비교 해야하나?

 

물론 비교할려면 방법은 많지만 위에 방법은 추천하지 않는다.

 

팀장님이 주신 해결방법이다.. 천재 ㄷㄷㄷ

 

비교하는 데이터 class에 equal을 override하는 방법으로 정말 간단하게 해결되었다.

 

public class CountryTitleData : INotifyPropertyChanged
    {
        bool _isChecked;
        public event PropertyChangedEventHandler PropertyChanged;
 
        public string Name { get; set; }
        public string Flag { get; set; }
        public string Code { get; set; }
        public bool Checked
        {
            get
            {
                return _isChecked;
            }
            set
            {
                if (_isChecked != value)
                {
                    _isChecked = value;
                    if (PropertyChanged != null)
                    {
                        PropertyChanged(this, new PropertyChangedEventArgs("Checked"));
                    }
                }
            }
        }
        public int FontSize { get; set; }
 
        public override bool Equals(object obj)
        {
            CountryTitleData cd =  obj as CountryTitleData;
 
            return Code == cd.Code;
        }
    }
Posted by 동동(이재동)
Windows Phone 72010. 8. 13. 16:16

윈도우폰을 사용중에  전화가 오거나 빙검색을 하기 위해 서치 버튼을 눌렀다가 다시 원래 화면으로 돌아온다면?

모든 텍스트 박스나 바인딩이 초기 값으로 세팅해져있을것이다.

예를들면 랜덤넘버 프로그램에서 최소값 3과 최대값 300을 썻는데  빙검색을 누르거나 전화를 받았거나 문자를 받았다면

사용자는 자기가 하고 있던값이 사라지면 황당할것이다.

다행히 파일에 저장하는 IsolatedStorage가 있지만 우리는 영원히 저장하는것이 아니라 잠시 전화가 오기전의 상태를 저

장하기를 원한다.

우리가 그 상태정보를 영원히 가지고 있을 필요가 없다는것이다.

 

그렇다면 IsolatedStorage도 좋은 선택이 아니다.

 

PhoneApplicationService.Current.State

 

이걸 쓰면 어떨까? 이건 사용법은 isolatedStroage와 같지만 다른점은 어플이 종료가 될때는 사라진다는점이다.

즉 종료하지 않고 어떤 다른곳 으로 네비게이션을 하게 된다면 여기 데이터는 계속 살아있지만 종료를 하면 없어지기때문에 현재 상태를 파일에 쓰는것 보다 더 나은 성능 향상과 메모리 사용률 최적화를 기대할수 있다.

 

이걸 적용하기 위해서 네비게이션을 이동하기 전에 실행되는 함수와 이동이 되었을때 실행이 되는 함수에 넣으면 된다.

 

먼저 이동전에 현제 상태를 PhoneApplicationService.Current.State에 저장한다.

protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
{
    RandomNumberStateData _randomNumberStateData = new RandomNumberStateData();
    _randomNumberStateData.TextBoxStart = StartNumberText.Text;
    _randomNumberStateData.TextBoxEnd = EndNumberText.Text;
    _randomNumberStateData.ButtonRandomNumber = button.Content.ToString();            
    
    if (PhoneApplicationService.Current.State.ContainsKey("RandomNumberState") == true)
    {
        PhoneApplicationService.Current.State.Remove("RandomNumberState");             
    }
 
    if (e.Content == null)
    {
        PhoneApplicationService.Current.State.Add("RandomNumberState", _randomNumberStateData);
    }
}

 

이렇게 저장을 하였으면  이제 볼일을 보고 다시 왔을때 이 상태 값들을 다시 원래 대로 복원을 해줘야 한다.

 

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
       {
           var dc = this.DataContext as RandomNumberViewModel;
           dc.ShakeSenserStart();
 
           if (PhoneApplicationService.Current.State.ContainsKey("RandomNumberState") == true)
           {
               var randomNumberStateData = PhoneApplicationService.Current.State["RandomNumberState"] as RandomNumberStateData;                
               dc.MinNumberValue = randomNumberStateData.TextBoxStart;
               dc.MaxNumberValue = randomNumberStateData.TextBoxEnd;
               dc.RandomNumberValue = randomNumberStateData.ButtonRandomNumber;
               //button.Content = randomNumberStateData.ButtonRandomNumber;                
           }
       }

 

큰 어려움은 없다 . 

참고 : http://windowsteamblog.com/windows_phone/b/wpdev/archive/2010/07/20/understanding-the-windows-phone-application-execution-model-tombstoning-launcher-and-more-part-3.aspx

Posted by 동동(이재동)
Windows Phone 72010. 8. 9. 16:33

MVVM을 쓰면서 페이지 이동을 할때에는 꼭 Page 에서 해야만 했다.


즉 뷰딴에서만 이동이 가능했다.


예를 들면

var uri = new Uri(string.Format("/TypenWork;component/Views/OptionPage.xaml"), UriKind.RelativeOrAbsolute);
NavigationService.Navigate(uri);

이렇게 하여야만 했지만


그래서 꼭 behind딴에서 코딩을 하여 mvvm 고유의 깔끔함이 없어졌다.


하지만 페이지 이동을 딴 곳 즉 ViewModel 이나 Model쪽에서 하고 싶을때가 많다(거의 90%)


그럴때는 어떻게 할까... 언제까지 datacontext를 형변환 하여 사용할것인가?


팀장님이 발견한 방법이다


var temp = App.Current.RootVisual as PhoneApplicationFrame;
temp.Navigate(new Uri("/UnitConverter;component/Views/MainListView.xaml",UriKind.RelativeOrAbsolute));


이렇게 app의 RootVisual를 PhoneApplicationFrame을 캐스팅하여 사용하는 방법이다 굿~^^


이제 자유롭게 어디서든 Navigate 를 사용할수 있다.

Posted by 동동(이재동)
Windows Phone 72010. 7. 26. 16:22

이건 Silverlight나 WPF나 다 했던 것인데 잊어먹어서 다시 쓴다…

일단 리소스 파일을 하나 만든다. add new item~ 으로 만든후 리소스를 적는데

image

 

위에 보면 "Access Modifier” 에  internal로 되어있다. 이걸 public 으로 꼭 고치자  왜냐하면 나는 전 구역에 사용해야 하기때문이다 ~

 

<phone:PhoneApplicationPage.Resources>
<local:LocalizedStrings x:Key="LocalizedStrings"/>
</phone:PhoneApplicationPage.Resources>
 
자 이렇게 해당 View Xaml에 리소스를 등록하자 공용으로 사용하고 싶으면 app.xaml에 저장~
자  이제 리소스를 받는 클래스를 만들자~
 
public class LocalizedStrings
{
private static AppResources localizedresources = new AppResources();

public LocalizedStrings()
{
}

public AppResources LocalizedResources
{
get
{
return localizedresources;
}
}
}
 
이제 실제 Text 에 바인딩 시켜보자~
<TextBlock Text="{Binding Path=LocalizedResources.Title, Source={StaticResource LocalizedStrings}}" x:Name="textBlockListTitle" FontSize="60"/>            

리소스에  등록된 Title 이 나오는걸 볼수 있다.
Posted by 동동(이재동)
노래2010. 7. 23. 13:55

Mocca - The Best Thing



I've got the best thing in the world
Coz' I got you in my heart
And this screw little world
Let's hold hand together
We can share forever
Maybe someday the sky will be coloured with our love

I wake up in the morning
Feeling emptyness in my heart
This pain is just too real
I dream about you, with someone else
Please say that you love me
That we'll never be apart

You have to promise
That you will be faithfull
And there will be lots and lots of love
It is the thing that really matters in this world…

'노래' 카테고리의 다른 글

white (화이트) -mocca  (0) 2010.10.01
Miss A Bad Girl Good Girl  (0) 2010.07.23
달콤한 노래 모음  (0) 2010.07.15
이지혜 -곰돌이  (0) 2010.07.15
[가사] 커플 - 김용준  (0) 2009.08.05
Posted by 동동(이재동)
노래2010. 7. 23. 10:57

You don't know me X 4
So shut off boy X 3
So shut off, shut off


앞에선 한마디도 못하더니
뒤에선 내 얘길 안 좋게 해
참 어이가 없어

(Hello hello hello) 나 같은 여잔 처음
(으로 으로 으로) 본 것 같은데 왜
나를 판단하니 내가 혹시 두려운 거니

겉으론 (Bad girl)
속으론 (Good girl)
나를 잘 알지도 못하면서
내 겉모습만 보면서
한심한 여자로 보는
너의 시선이 난 너무나 웃겨

춤출 땐 (Bad girl)
사랑은 (Good girl)
춤추는 내 모습을 볼 때는
넋을 놓고 보고서는
끝나니 손가락질하는
그 위선이 난 너무나 웃겨



이런 옷 이런 머리 모양으로
이런 춤을 추는 여자는 뻔해
하, 네가 더 뻔해

(Hello hello hello) 자신 없으면 저
(뒤로 뒤로 뒤로) 물러서면 되지
왜 자꾸 떠드니 네 속이 훤히 보이는 건 아니

겉으론 (Bad girl)
속으론 (Good girl)
나를 잘 알지도 못하면서
내 겉모습만 보면서
한심한 여자로 보는
너의 시선이 난 너무나 웃겨

춤출 땐 (Bad girl)
사랑은 (Good girl)
춤추는 내 모습을 볼 때는
넋을 놓고 보고서는
끝나니 손가락질하는
그 위선이 난 너무나 웃겨



(날 감당) 할 수 있는 남잘 찾아요 진짜 남자를 찾아요
(말로만) 남자다운 척할 남자 말고
(날 불안)해 하지 않을 남잔 없나요 자신감이 넘쳐서
내가 나일 수 있게 자유롭게 두고 멀리서 바라보는

겉으론 (Bad girl)
속으론 (Good girl)
나를 잘 알지도 못하면서
내 겉모습만 보면서
한심한 여자로 보는
너의 시선이 난 너무나 웃겨

춤출 땐 (Bad girl)


'노래' 카테고리의 다른 글

white (화이트) -mocca  (0) 2010.10.01
Mocca - The Best Thing  (0) 2010.07.23
달콤한 노래 모음  (0) 2010.07.15
이지혜 -곰돌이  (0) 2010.07.15
[가사] 커플 - 김용준  (0) 2009.08.05
Posted by 동동(이재동)
노래2010. 7. 15. 14:38

일단 계속 업데이트 할예정


이지혜 장석연 -사랑 100


보람효연지연- 우유보다커피 (이건 그렇제 좋지 않은듯?)

'노래' 카테고리의 다른 글

Mocca - The Best Thing  (0) 2010.07.23
Miss A Bad Girl Good Girl  (0) 2010.07.23
이지혜 -곰돌이  (0) 2010.07.15
[가사] 커플 - 김용준  (0) 2009.08.05
음악 무료듣기 사이트  (0) 2009.07.31
Posted by 동동(이재동)
노래2010. 7. 15. 10:21
My sweet baby

오빠만나고 온날
오빠도, 나처럼 설레일까
배나오고 뚱뚱해 자주 토라져도 오빠는
귀여운 곰돌이

난 말야
거리만 지나가도 남자들 눈이빠지게 날 봐
친구들내게 물어봐 그 오빠 돈이 많냐고
이상한듯 날 봐

사랑스러운 걸 오빤 귀여운걸
나에겐 빛나는 왕자님
연예인 열트럭을 갖다줘도
바꾸지 않을 우리 오빠 오빠 정말 사랑해

분홍빛 립스틱이 참 좋아
오빠가 요즘 내 입술만봐
드라마장면처럼 멋진 남자답게
내 입술 훔쳐도 괜찮아

오빠는 배나온게 귀여워
통통한 배 베고자면 좋아
편안하고 참 따뜻해 눈이 스르륵 감겨와
내 곰돌이인형

사랑스러운 걸 오빤 귀여운걸
나에겐 빛나는 왕자님
연예인 열트럭을 갖다줘도
바꾸지 않을 우리 오빠
오빠 정말 사랑해

저 별은 오빠 별
옆에 별은 내 별
밤 하늘 반짝이는 우리
영원히 빛을 잃지 않기로해
평생 내 반쪽이 되어줘

오빠 정말 사랑해
나의 사랑 곰돌이

'노래' 카테고리의 다른 글

Miss A Bad Girl Good Girl  (0) 2010.07.23
달콤한 노래 모음  (0) 2010.07.15
[가사] 커플 - 김용준  (0) 2009.08.05
음악 무료듣기 사이트  (0) 2009.07.31
[노래] 민경 - 우린 안어울려요  (0) 2009.05.18
Posted by 동동(이재동)
Windows Phone 72010. 7. 13. 15:16

드디어 오늘 나왔다.
지금까지 CTP 버전으로 얼마나 힘들게 개발하였던가?
근데 응? 추가된거는 별로 없고 클래스이름들만 다 바껴서 지금까지 CTP로 만들었던거 다시 교체 작업을 해야 한다 ㅠ.ㅠ

일단 다운은 http://www.silverlight.net/getstarted/devices/windows-phone/ 여기서 받을수 있고
바뀐점은 안에 문서를 보면 안다. 일단 내가 만든 프로젝트에서 바꿔야 하는것을 알아보자~

App.xaml

<!--RootFrame points to and loads the first page of your application-->
<Application.RootVisual>
<phoneNavigation:PhoneApplicationFrame x:Name="RootFrame" Source="/Views/ExchangeConverterMainView.xaml"/>
</Application.RootVisual>





이렇게 되어 있던 처음 스타트 페이지를 설정하는 부분이

Properties-WMAppManifest.xml 여기로 옮겨졌다(저 윗부분은 app,xaml에서 삭제할 것 )





<Tasks>
<DefaultTask Name ="_default" PlaceHolderString="Default task"/>
</Tasks>





기존 이렇게 되어 있던것이




<Tasks>
<DefaultTask Name ="_default" NavigationPage="/Views/ExchangeConverterMainView.xaml"/>
</Tasks>





이렇게 바꾸면 시작페이지가 잘 설정된다.



자 이제 예전의 sdk 레퍼런스를 지우자~ 원래 이걸 젤첨에 했어야 했는데 ㅋ



기존이 경고가 떳다.





이걸 삭제하고



새로 추가하자..  달라진점은 보면 알것이다~

그리고 app.xaml 정의 부분




<Application 
x:Class="ExchangeConverter.App"
xmlns:local="clr-namespace:ExchangeConverter"
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:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">





도 이렇게 간단하게 바꾸고~ 중요한건 app.xaml.cs 도 바꿔야 한다는것이다



여기에는 너무 많으니 차라리 새로운 프로젝트를 만들어서 app.xaml.cs에 내용을 복사해 넣자!!!




<phoneNavigation:PhoneApplicationPage
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phoneNavigation="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Navigation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:phone="clr-namespace:HugeFlow.Phone.Controls;assembly=HugeFlow.Phone.Controls"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:HugeFlow_CommandPattern_Interactivity="clr-namespace:HugeFlow.CommandPattern.Interactivity;assembly=HugeFlow.MVVM" x:Name="phoneApplicationPage"
x:Class="ExchangeConverter.MainPage"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}">





기존 이렇게 되어있던 Page~ phoneNavigation으로 되어있던 것을

phoneNavigation을 바꾸고 phone으로 바꾸고 phonNavigation을 삭제하고 아까 레퍼런스에 추가했던 phone이랑 Shell을 추가하자(저위에 phone은 중복된거라 이름을 바꿨다)





<phone:PhoneApplicationPage
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:c="clr-namespace:HugeFlow.Phone.Controls;assembly=HugeFlow.Phone.Controls"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:HugeFlow_CommandPattern_Interactivity="clr-namespace:HugeFlow.CommandPattern.Interactivity;assembly=HugeFlow.MVVM" x:Name="phoneApplicationPage"
x:Class="ExchangeConverter.MainPage"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}">





자 바꾸었다~

그리고 applicationBar도 업글이 되었는데 이건 Text를 추가를 꼭해줘야 한다 안하면 에러남 ~






<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True">
<shell:ApplicationBarIconButton IconUri="Images/appbar.feature.settings.dark.png" x:Name="SettingButton" Click="SettingButton_Click" Text="Setting"/>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>





이렇게 바꾸면 될듯~




또 바뀐게 머가 있을까?

Posted by 동동(이재동)
Windows Phone 72010. 7. 9. 16:38

유동적인 Button에서 Template를 입혀보자

foreach (var item in _appBoxModel.GetFavoriteListFromFile())
{
Button favoriteButton = new Button()
{
Content = item.Name,
DataContext = item,
Width = 150,
Height = 150,
FontSize = 15,
Template = this.Resources["xControl"] as ControlTemplate,
Style = Application.Current.Resources[item.Style] as Style

};





일단 유동적으로 만들어질 버튼에 templete을 지정하고


xaml에


 



<phoneNavigation:PhoneApplicationPage.Resources>                    

<ControlTemplate x:Name="xControl" TargetType="Button" >
<StackPanel>
<StackPanel>
<Image Source="{Binding Image}" Width="100" Height="100" />
</StackPanel>
<TextBlock Text="{Binding Name}" HorizontalAlignment="Center"/>
</StackPanel>
</ControlTemplate>
</phoneNavigation:PhoneApplicationPage.Resources>



 


이렇게 리소스로 넣으면 된다~ 바인딩 데이터는 dataContext로~
Posted by 동동(이재동)
Windows Phone 72010. 7. 7. 16:30

 

내가 할려던 일은 윈도우7 폰 프로젝트에서 만든 프로젝트를 하나로 합쳐서 한개의 어플로 관리해야 하는데 지금까지 만든 프로젝트를 쭉 불러와서 또 다른 하나의 솔루션을 만들었다.

여기서 나의 문제점이 생겼다.

 

일단 같은 프로젝트에 있는 xaml 끼리는 navigation 이 잘된다.

하지만 다른 프로젝트에 있는 xaml로 가야 된다면?

일단 생각해낸 방법이 children.add() 이다.. 이건 물론 되긴하지만 command patton 이나 application bar 가 로딩이 안되서 패스

그래서 도저히 navigationService.Navigate(URI) 밖에 방법이 없다고 생각하여 킴팀장님한테 헬프를 왜쳤더니 오전내내 찾아도 없던걸 한방에 찾아내셧다…

이런… 나도 나름 검색 잘한다고 생각했는데 ㅠ.ㅠ

결과적으로는 이렇다.

 

var uri = new Uri("/RandomNumber;component/Views/RandomNumber.xaml", UriKind.RelativeOrAbsolute);
NavigationService.Navigate(uri);



 


/프로젝트 이름;component/해당 xaml 경로


 


잘되지만 app.Xaml은 읽어오지 못하므로 ServiceLocator 나 app.xaml에 있는 스타일은 사용할수 없다.


 


 




Posted by 동동(이재동)
Windows Phone 72010. 6. 29. 10:43

점점 mvvm에 대해서 아는것 같다…

일반 컨트롤의 이벤트는 command를 이용해서 빼는것은 이제 조금씩 익숙해지고 있다.

하지만 ListBox안의 Template에서 이벤트를 빼야 한다면? 자 해보자

<ListBox x:Name="SearchCountryListBox" ItemsSource="{Binding SearchCountryListBoxItemSource}" Height="240">
 
                   <ListBox.ItemTemplate>
 
                       <DataTemplate>
 
                           <Grid>
 
                               <Grid.ColumnDefinitions>
 
                                   <ColumnDefinition Width="Auto" />
 
                                   <ColumnDefinition Width="*" />
 
                                   <ColumnDefinition Width="Auto" />
 
                               </Grid.ColumnDefinitions>
 
                               <Image Source="{Binding Flag}"  Width="80" Height="50" Grid.Column="0" />
 
                               <TextBlock Text="{Binding Name}"  FontSize="35" Grid.Column="1" Margin="40,0,40,0"/>
 
                               <Button x:Name="button" Content="button "  Grid.Column="2" >
 
                                   <i:Interaction.Behaviors>
 
                                       <HugeFlow_CommandPattern_Interactivity:ExecuteAncestorInstantCommandBehavior CommandName="SearchCountrySelectButtonCommand">
 
                                           <i:Interaction.Triggers>
 
                                               <i:EventTrigger SourceName="button" EventName="Click">
 
                                                   <i:InvokeCommandAction CommandName="CommandTriggers"/>
 
                                               </i:EventTrigger>
 
                                           </i:Interaction.Triggers>
 
                                       </HugeFlow_CommandPattern_Interactivity:ExecuteAncestorInstantCommandBehavior>
 
                                   </i:Interaction.Behaviors>
 
                               </Button>
 
                           </Grid>
 
                       </DataTemplate>
 
                   </ListBox.ItemTemplate>
 
               </ListBox>
 
 




 




보이는가? 버튼에 command pattern 적용한것을?



이렇게 만들려면 치는거보다 블랜드에서 하는게 편하다…



 



 



 



 





해당 listbox item template에 들어가서



 



 



 



일단 ExecuteAncestorInstatntCommandBehavior를 더블 클릭하여 만든다.





여기서 부턴 일반 commandPattern이랑 같으니까 생략~


아 그리고 중요한건 블랜드에서 CommandName을 쓸때 수동으로 쓸수 밖에 없다 DataBinding이 뜨지 않기때문에

만든 커맨드 이름을 쓰면 된다.^^

Posted by 동동(이재동)
Windows Phone 72010. 6. 28. 11:40

대부분 문자를 찾을때는 포함되어 있는지 없는지 알기 위해 Contains를 이용한다.. 하지만

 

Korea가 있는데 내가 Ko라고 쳤는데 Korea만 나와야하는데 Contains를 쓰면 reaKo도 나오게 된다...

 

이럴때 사용하는것이 StrignWith이다.

 

첫글자부터 사용해준다.

 

이거 없었으면 toArray로 하나하나 비교해야됬었을수도

 

참고 : http://msdn.microsoft.com/en-us/library/ms228630(VS.80).aspx

Posted by 동동(이재동)
좋은 프로그램2010. 6. 24. 09:11

JDLEE

2207703232

[#FILE|UltraMon_3.0.10--x32-x64.7z|pds/201006/24/37/|mid|0|0|pds20|0#]

Posted by 동동(이재동)