PropertyChanged problem..
-
2012년 3월 10일 토요일 오전 8:46
I'm following the Metro C++ tutorial:
http://msdn.microsoft.com/en-us/library/windows/apps/hh465045.aspxJust for testing purpose I decide to update FeedData to fire notification changed when Title property changed.
As in change from
[Windows::UI::Xaml::Data::Bindable] public ref class FeedData sealed { public: property Platform::String^ Title; };
to
[Windows::UI::Xaml::Data::Bindable] public ref class FeedData sealed : public Common::BindableBase { #pragma region Title private: Platform::String^ mTitle; public: property Platform::String^ Title { Platform::String^ get() { return MTitle; } void set(Platform::String^ value) { if(value == mTitle) return; mTitle = value; OnPropertyChanged("Title"); } } #pragma endregion };
And it worked well in part 1
In part 2, when multiple feed data are loaded, the application kind of freeze while loading data after updating the title of 2nd feed.
What Can be happening? Confused.. as the FeedData is still a private method property at this stage...
FeedData^ App::GetFeedData(SyndicationFeed^ feed) { FeedData^ feedData = ref new FeedData(); // Get the title of the feed (not the individual posts). feedData->Title = feed->Title->ToString(); // ... freezing when coming here the 2nd time ...
모든 응답
-
2012년 3월 13일 화요일 오후 12:51중재자
Hi
I'm looking into this issue and update asap.
Yi
Yi Feng Li [MSFT]
MSDN Community Support | Feedback to us
-
2012년 3월 15일 목요일 오전 1:11중재자
Could you email me your project in this problem state to look into please?
DavidLam AT Microsoft DOT COM
Thanks!
David Lamb
-
2012년 3월 15일 목요일 오후 1:18Thanks, just emailed it!
-
2012년 3월 16일 금요일 오전 2:24중재자
Turns out there were Platform::COMException exceptions being logged in the output window.
Breaking on one of the exceptions, the error was: 0x8001010e . The winerror.h defines this as RPC_E_WRONG_THREAD The application called an interface that was marshalled for a different thread.
Looking at the callstack, there was a PPL concurrency task continuation executing. Looking at the App.xaml.cpp line 128 we see they were configured to use any thread (in this case background threads)
concurrency::task_continuation_context::use_arbitrary
See this document for more information on this topic: Creating Asynchronous Operations in C++ for Metro style Apps
It details how task_continuation_context affects the apartment the continuation is executed from in this section, Controlling the Execution Thread. The simplest way to correct the problem in this project is to change the task_continuation_context to ::use_default
//Remark this line }, concurrency::task_continuation_context::use_arbitrary()) //change to use_default },concurrency::task_continuation_context::use_default())
Thanks!
David Lamb
- 편집됨 DavidLambMicrosoft Employee, Moderator 2012년 3월 16일 금요일 오전 2:25
- 답변으로 표시됨 lloyd 2012년 3월 16일 금요일 오전 9:05
-
2012년 3월 16일 금요일 오전 9:06
ho... I.. thought about Async but I dismissed it.. :~
I guess I have to read a bit more...
Thanks! :)
-
2012년 3월 16일 금요일 오후 3:03중재자
It wasn't obvious for me either when I first saw it. It took a bit to track it down.
Great question!
David Lamb

