public override DataTemplate SelectTemplate(object item, DependencyObject container) { IToolWindowViewModel model = item as IToolWindowViewModel; if (model == null) { return(base.SelectTemplate(null, container)); } if (model.Options.UseFlatUI) { return(((FrameworkElement)container).FindResource("FlatDataTemplate") as DataTemplate); } return(((FrameworkElement)container).FindResource("TreeDataTemplate") as DataTemplate); }
public InternalBlameViewModel(string filePath, int?lineNumber, IToolWindowViewModel tool) { this.blameHelper = new BlameHelper(tool); this.mergeHelper = new MergeHelper(tool); FilePath = filePath; PreviousRevisionCommand = new DelegateCommand(NavigateToPreviousRevision, CanNavigateToPreviousRevision); NextRevisionCommand = new DelegateCommand(NavigateToNextRevision, CanNavigateToNextRevision); SpecifiedRevisionCommand = new DelegateCommand(NavigateToSpecifiedRevision, CanNavigateToSpecifiedRevision); LastRevisionCommand = new DelegateCommand(NavigateToLastRevision, CanNavigateToLastRevision); CompareWithPreviousCommand = new DelegateCommand(CompareWithPrevious, CanCompareWithPrevious); CompareCurrentFileCommand = new DelegateCommand(CompareCurrentFile, CanCompareCurrentFile); CopyCommentCommand = new DelegateCommand(CopyComment, CanCopyComment); int line = lineNumber - 1 ?? 0; InitializeFileDiffInfo(); Blame = fileDiffInfo.BlameAtRevision(LastRevision); CurrentRevision = LastRevision; CurrentLine = Blame.ElementAtOrDefault(line); }
public MergeHelper(IToolWindowViewModel tool) { ToolWindowViewModel = tool; }
public BlameHelper(IToolWindowViewModel tool) { toolWindowViewModel = tool; }