Search Results

Search found 4 results on 1 pages for 'ronag'.

Page 1/1 | 1 

  • Should Item Grouping/Filter be in the ViewModel or View layer?

    - by ronag
    I'm in a situation where I have a list of items that need to be displayed depending on their properties. What I'm unsure of is where is the best place to put the filtering/grouping logic of the viewmodel state? Currently I have it in my view using converters, but I'm unsure whether I should have the logic in the viewmodel? e.g. ViewModel Layer: class ItemViewModel { DateTime LastAccessed { get; set; } bool IsActive { get; set; } } class ContainerViewModel { ObservableCollection<Item> Items {get; set;} } View Layer: <TextView Text="Active Items"/> <List ItemsSource={Binding Items, Converter=GroupActiveItemsByDay}/> <TextView Text="Active Items"/> <List ItemsSource={Binding Items, Converter=GroupInActiveItemsByDay}/> or should I build it like this? ViewModel Layer: class ContainerViewModel { ObservableCollection<IGrouping<string, Item>> ActiveItemsByGroup {get; set;} ObservableCollection<IGrouping<string, Item>> InActiveItemsByGroup {get; set;} } View Layer: <TextView Text="Active Items"/> <List ItemsSource={Binding ActiveItemsGroupByDate }/> <TextView Text="Active Items"/> <List ItemsSource={Binding InActiveItemsGroupByDate }/> Or maybe something in between? ViewModel Layer: class ContainerViewModel { ObservableCollection<IGrouping<string, Item>> ActiveItems {get; set;} ObservableCollection<IGrouping<string, Item>> InActiveItems {get; set;} } View Layer: <TextView Text="Active Items"/> <List ItemsSource={Binding ActiveItems, Converter=GroupByDate }/> <TextView Text="Active Items"/> <List ItemsSource={Binding InActiveItems, Converter=GroupByDate }/> I guess my question is what is good practice in terms as to what logic to put into the ViewModel and what logic to put into the Binding in the View, as they seem to overlap a bit?

    Read the article

  • Pipe between two console applications?

    - by ronag
    How can I pipe between two separate console application running in different console windows? e.g. I would like to do something similar to: ffmpeg -i 0.flv -vcodec mpeg4 -f asf -s cif - | vlc - However, I would like to do this from two separate windows, which doesn't work, I guess this is because standard out is local to cmd windows. cmd window 1: ffmpeg -i 0.flv -vcodec mpeg4 -f asf -s cif - cmd window 2: vlc - Is there any way to programmatically achieve this? What exactly does | do behind the scenes?

    Read the article

  • Get the Time Interval without ITimer

    - by ronag
    In my application I am hosting a flash activex control, based on the following implementation. However I need to know in what fps the control is running in when it is "ticked". The only way I know of to do this is to implement ITimerService and ITimer to get the vtimeInterval argument from ITimer::Advise. However, I do not want to control my own custom ITimer, instead I want the control to be timed using the default timer (basically sends WM_USER + 1 messages to the message queue at proper intervals) which is used when a custom ITimer is not provided. How can I read the vTimeInterval while still using the default timer?

    Read the article

  • ffmpeg async io?

    - by ronag
    Anyone know if ffmpeg does asynchronous file io? That is, the input file is read in a separate thread as to avoid io blocking the processing thread? Basically what I want to figure out is whether or not i need to do calls to "av_read_frame" inside a separate thread (to avoid blocking) or if ffmpeg alrdy handles this issue? How might I figure this out? I've tried downloading the ffmpeg source but haven't been able to find anything useful.

    Read the article

1