sc 10 months ago
parent
commit
605976c73a
  1. 8
      View/ProductionPlanningView.xaml
  2. 20
      View/ProductionPlanningView.xaml.cs
  3. 44
      ViewModel/ProductionPlanningModel.cs

8
View/ProductionPlanningView.xaml

@ -21,13 +21,7 @@
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<lvc:CartesianChart Series="{Binding Series}" XAxes="{Binding XAxes}" TooltipPosition="Hidden">
</lvc:CartesianChart>
<WebBrowser Name="webBrowser" />
</Grid>
<StackPanel x:Name="scr" Grid.Row="1" Height="60" Background="#FF00204E" Orientation="Horizontal">
<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD">

20
View/ProductionPlanningView.xaml.cs

@ -41,7 +41,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
public ProductionPlanningView()
{
InitializeComponent();
DataContext = new ProductionPlanningModel();
}
private SQLiteHelper SQLiteHelpers = null; //定义数据库
@ -49,7 +48,24 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
private void UserControl_Loaded(object sender, RoutedEventArgs e)//打开页面时的操作
{
string html = @"
<html>
<head>
<script type='text/javascript'>
function showMessage() {
alert('Hello from JavaScript!');
}
</script>
</head>
<body>
<button onclick='showMessage()'>Click Me</button>
</body>
</html>";
webBrowser.NavigateToString(html);
}
private void ListViewItem_Quit(object sender, System.Windows.Input.MouseButtonEventArgs e)//退出事件

44
ViewModel/ProductionPlanningModel.cs

@ -32,49 +32,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
{
public partial class ProductionPlanningModel : ObservableObject//ViewModelBase
{
public ISeries[] Series { get; set; }
public Axis[] XAxes { get; set; } =
{
new DateTimeAxis(TimeSpan.FromSeconds(5) , date => date.ToString("yyyy-MM-dd HH:mm"))
{
CrosshairLabelsBackground = SKColors.DarkGray.AsLvcColor(),
CrosshairLabelsPaint = new SolidColorPaint(SKColors.DarkSlateBlue, 1),
CrosshairPaint = new SolidColorPaint(SKColors.DarkSlateGray, 1),
},
};
public ProductionPlanningModel()
{
Series = new ISeries[]
{
new RowSeries<int>
{
Values = new List<int> { 3 },
Stroke = null,
DataLabelsPaint = new SolidColorPaint(new SKColor(45, 45, 45)),
DataLabelsSize = 14,
DataLabelsPosition = DataLabelsPosition.Middle
},
new RowSeries<int>
{
Values = new List<int> { 4},
Stroke = null,
DataLabelsPaint = new SolidColorPaint(new SKColor(45, 45, 45)),
DataLabelsSize = 14,
DataLabelsPosition = DataLabelsPosition.Middle
},
new RowSeries<int>
{
Values = new List<int> { -2 },
Stroke = null,
DataLabelsPaint = new SolidColorPaint(new SKColor(45, 45, 45)),
DataLabelsSize = 14,
DataLabelsPosition = DataLabelsPosition.Middle
} };
}
}
}

Loading…
Cancel
Save