예제 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            NormalPostItemControl newItem = new NormalPostItemControl();

            newItem.viewModel.Title     = "";
            newItem.viewModel.Writer    = "";
            newItem.viewModel.Recommand = 0;
            newItem.control             = this;
            StaticVar.IdeaListViewModel.Items.Add(newItem);
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            NormalPostItemControl newItem = new NormalPostItemControl();

            newItem.viewModel.Title     = tbTitle.Text;
            newItem.viewModel.Writer    = (StaticVar.NickName == null) ? "DGSW" : StaticVar.NickName;
            newItem.viewModel.Content   = tbContent.Text;
            newItem.control             = new WebPostControl();
            newItem.control.DataContext = newItem.viewModel;
            StaticVar.back();
            StaticVar.AppListViewModel.Items.Add(newItem);
        }
        void OnPostingClicked()
        {
            NormalPostItemControl newItem = new NormalPostItemControl();

            newItem.viewModel.Title     = Title.Text;
            newItem.viewModel.Writer    = (StaticVar.NickName == null) ? "DGSW": StaticVar.NickName;
            newItem.viewModel.Content   = PostContent.Text;
            newItem.control             = new WebPostControl();
            newItem.control.DataContext = newItem.viewModel;
            StaticVar.WebListViewModel.Items.Add(newItem);
            StaticVar.back();
            StaticVar.webList.lstListView.Items.Add(newItem);
        }