Add more UI for document generation
This commit is contained in:
parent
f150ee329a
commit
b538f22ad5
|
|
@ -9,9 +9,13 @@ namespace Microsoft.VisualStudio.RazorExtension.RazorInfo
|
||||||
{
|
{
|
||||||
public class DocumentSnapshotViewModel : NotifyPropertyChanged
|
public class DocumentSnapshotViewModel : NotifyPropertyChanged
|
||||||
{
|
{
|
||||||
|
private double _progress;
|
||||||
|
|
||||||
internal DocumentSnapshotViewModel(DocumentSnapshot document)
|
internal DocumentSnapshotViewModel(DocumentSnapshot document)
|
||||||
{
|
{
|
||||||
Document = document;
|
Document = document;
|
||||||
|
|
||||||
|
InitializeGeneratedDocument();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal DocumentSnapshot Document { get; }
|
internal DocumentSnapshot Document { get; }
|
||||||
|
|
@ -19,6 +23,28 @@ namespace Microsoft.VisualStudio.RazorExtension.RazorInfo
|
||||||
public string FilePath => Document.FilePath;
|
public string FilePath => Document.FilePath;
|
||||||
|
|
||||||
public string TargetPath => Document.TargetPath;
|
public string TargetPath => Document.TargetPath;
|
||||||
|
|
||||||
|
public bool CodeGenerationInProgress => _progress < 100;
|
||||||
|
|
||||||
|
public double CodeGenerationProgress => _progress;
|
||||||
|
|
||||||
|
private async void InitializeGeneratedDocument()
|
||||||
|
{
|
||||||
|
_progress = 0;
|
||||||
|
OnPropertyChanged(nameof(CodeGenerationInProgress));
|
||||||
|
OnPropertyChanged(nameof(CodeGenerationProgress));
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Document.GetGeneratedOutputAsync();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_progress = 100;
|
||||||
|
OnPropertyChanged(nameof(CodeGenerationInProgress));
|
||||||
|
OnPropertyChanged(nameof(CodeGenerationProgress));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -301,6 +301,22 @@
|
||||||
<ListView.View>
|
<ListView.View>
|
||||||
<GridView
|
<GridView
|
||||||
AllowsColumnReorder="False">
|
AllowsColumnReorder="False">
|
||||||
|
<GridViewColumn
|
||||||
|
Width="50">
|
||||||
|
<GridViewColumnHeader
|
||||||
|
Content="Status" />
|
||||||
|
<GridViewColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid>
|
||||||
|
<ProgressBar
|
||||||
|
Height="15"
|
||||||
|
Width="40"
|
||||||
|
IsIndeterminate="{Binding Path=CodeGenerationInProgress, Mode=OneWay}"
|
||||||
|
Value="{Binding Path=CodeGenerationProgress, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</GridViewColumn.CellTemplate>
|
||||||
|
</GridViewColumn>
|
||||||
<GridViewColumn
|
<GridViewColumn
|
||||||
Width="150">
|
Width="150">
|
||||||
<GridViewColumnHeader
|
<GridViewColumnHeader
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue