修正CPF
This commit is contained in:
parent
eb2152edae
commit
5f52372fb4
@ -64,9 +64,9 @@ namespace CPF.Charts
|
|||||||
Panel tipPanel;
|
Panel tipPanel;
|
||||||
TextBlock tipName;
|
TextBlock tipName;
|
||||||
Panel tipListPanel;
|
Panel tipListPanel;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
seriesPanel = FindPresenterByName<Panel>("seriesPanel");
|
seriesPanel = FindPresenterByName<Panel>("seriesPanel");
|
||||||
tipPanel = FindPresenterByName<Panel>("tipPanel");
|
tipPanel = FindPresenterByName<Panel>("tipPanel");
|
||||||
tipName = FindPresenterByName<TextBlock>("tipName");
|
tipName = FindPresenterByName<TextBlock>("tipName");
|
||||||
|
@ -269,9 +269,9 @@ namespace CPF.Charts
|
|||||||
Panel tipPanel;
|
Panel tipPanel;
|
||||||
TextBlock tipName;
|
TextBlock tipName;
|
||||||
Panel tipListPanel;
|
Panel tipListPanel;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
seriesPanel = FindPresenterByName<Panel>("seriesPanel");
|
seriesPanel = FindPresenterByName<Panel>("seriesPanel");
|
||||||
tipPanel = FindPresenterByName<Panel>("tipPanel");
|
tipPanel = FindPresenterByName<Panel>("tipPanel");
|
||||||
tipName = FindPresenterByName<TextBlock>("tipName");
|
tipName = FindPresenterByName<TextBlock>("tipName");
|
||||||
|
@ -74,9 +74,9 @@ namespace CPF.Controls
|
|||||||
Grid Month;
|
Grid Month;
|
||||||
Grid Year;
|
Grid Year;
|
||||||
|
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
Month = FindPresenterByName<Grid>("MonthView");
|
Month = FindPresenterByName<Grid>("MonthView");
|
||||||
Year = FindPresenterByName<Grid>("YearView");
|
Year = FindPresenterByName<Grid>("YearView");
|
||||||
var date = DisplayDate.Date;
|
var date = DisplayDate.Date;
|
||||||
|
@ -357,9 +357,9 @@ namespace CPF.Controls
|
|||||||
|
|
||||||
ScrollViewer scrollViewer;
|
ScrollViewer scrollViewer;
|
||||||
LineNumber lineNumber;
|
LineNumber lineNumber;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
scrollViewer = FindPresenterByName<ScrollViewer>("scrollViewer");
|
scrollViewer = FindPresenterByName<ScrollViewer>("scrollViewer");
|
||||||
lineNumber = FindPresenterByName<LineNumber>("lineNumber");
|
lineNumber = FindPresenterByName<LineNumber>("lineNumber");
|
||||||
var contentPresenter = scrollViewer.FindPresenterByName<Border>("contentPresenter");
|
var contentPresenter = scrollViewer.FindPresenterByName<Border>("contentPresenter");
|
||||||
|
@ -362,9 +362,9 @@ namespace CPF.Controls
|
|||||||
// return panel;
|
// return panel;
|
||||||
//}
|
//}
|
||||||
//Panel panel;
|
//Panel panel;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
//panel = GetItemsPanel();
|
//panel = GetItemsPanel();
|
||||||
//if (panel == null)
|
//if (panel == null)
|
||||||
//{
|
//{
|
||||||
|
@ -163,7 +163,7 @@ namespace CPF.Controls
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
UIElement contentPresenter;
|
UIElement contentPresenter;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
contentPresenter = FindPresenterByName<UIElement>("contentPresenter");
|
contentPresenter = FindPresenterByName<UIElement>("contentPresenter");
|
||||||
if (contentPresenter == null)
|
if (contentPresenter == null)
|
||||||
@ -192,7 +192,7 @@ namespace CPF.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnOverrideMetadata(OverrideMetadata overridePropertys)
|
protected override void OnOverrideMetadata(OverrideMetadata overridePropertys)
|
||||||
|
@ -281,12 +281,12 @@ namespace CPF.Controls
|
|||||||
Template(this, this.Children);
|
Template(this, this.Children);
|
||||||
}
|
}
|
||||||
IsInitialized = true;
|
IsInitialized = true;
|
||||||
OnInitializedAsync();
|
OnInitialized();
|
||||||
}
|
}
|
||||||
LoadStyle();
|
LoadStyle();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnInitializedAsync()
|
protected virtual void OnInitialized()
|
||||||
{
|
{
|
||||||
if (triggers != null)
|
if (triggers != null)
|
||||||
{
|
{
|
||||||
|
@ -202,7 +202,7 @@ namespace CPF.Controls
|
|||||||
}
|
}
|
||||||
internal DataGridScrollViewer viewer;
|
internal DataGridScrollViewer viewer;
|
||||||
VirtualizationPresenter<DataGridRow> presenter;
|
VirtualizationPresenter<DataGridRow> presenter;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
viewer = FindPresenter<DataGridScrollViewer>().FirstOrDefault(a => a.Name == "DG_ScrollViewer");
|
viewer = FindPresenter<DataGridScrollViewer>().FirstOrDefault(a => a.Name == "DG_ScrollViewer");
|
||||||
if (!viewer)
|
if (!viewer)
|
||||||
@ -254,7 +254,7 @@ namespace CPF.Controls
|
|||||||
}
|
}
|
||||||
columns.CollectionChanged += Columns_CollectionChanged;
|
columns.CollectionChanged += Columns_CollectionChanged;
|
||||||
viewer.contentPresenter.LayoutUpdated += ContentPresenter_LayoutUpdated;
|
viewer.contentPresenter.LayoutUpdated += ContentPresenter_LayoutUpdated;
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
var panel = ItemsHost as StackPanel;
|
var panel = ItemsHost as StackPanel;
|
||||||
if (!panel || panel.Orientation == Orientation.Horizontal)
|
if (!panel || panel.Orientation == Orientation.Horizontal)
|
||||||
{
|
{
|
||||||
|
@ -85,9 +85,9 @@ namespace CPF.Controls
|
|||||||
Triggers.Add(nameof(IsSelected), Relation.Me, null, (nameof(Background), "75,178,255"));
|
Triggers.Add(nameof(IsSelected), Relation.Me, null, (nameof(Background), "75,178,255"));
|
||||||
}
|
}
|
||||||
DataGridCellTemplate cellTemplate;
|
DataGridCellTemplate cellTemplate;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
cellTemplate = FindPresenter<DataGridCellTemplate>().FirstOrDefault(a => a.Name == "CellTemplate");
|
cellTemplate = FindPresenter<DataGridCellTemplate>().FirstOrDefault(a => a.Name == "CellTemplate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ namespace CPF.Controls
|
|||||||
Triggers.Add(new Styling.Trigger { Property = nameof(IsSelected), Setters = { { nameof(Background), "#ddd" } } });
|
Triggers.Add(new Styling.Trigger { Property = nameof(IsSelected), Setters = { { nameof(Background), "#ddd" } } });
|
||||||
}
|
}
|
||||||
internal Panel itemsPanel;
|
internal Panel itemsPanel;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
itemsPanel = FindPresenter<Panel>().FirstOrDefault(a => a.Name == "itemsPanel");
|
itemsPanel = FindPresenter<Panel>().FirstOrDefault(a => a.Name == "itemsPanel");
|
||||||
if (!itemsPanel)
|
if (!itemsPanel)
|
||||||
@ -74,7 +74,7 @@ namespace CPF.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
[PropertyChanged(nameof(IsSelected))]
|
[PropertyChanged(nameof(IsSelected))]
|
||||||
|
@ -47,14 +47,14 @@ namespace CPF.Controls
|
|||||||
|
|
||||||
internal Panel PART_ColumnHeadersPresenter;
|
internal Panel PART_ColumnHeadersPresenter;
|
||||||
internal UIElement contentPresenter;
|
internal UIElement contentPresenter;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
PART_ColumnHeadersPresenter = FindPresenter<Panel>().FirstOrDefault(a => a.Name == "PART_ColumnHeadersPresenter");
|
PART_ColumnHeadersPresenter = FindPresenter<Panel>().FirstOrDefault(a => a.Name == "PART_ColumnHeadersPresenter");
|
||||||
if (!PART_ColumnHeadersPresenter)
|
if (!PART_ColumnHeadersPresenter)
|
||||||
{
|
{
|
||||||
throw new Exception("需要Name为PART_ColumnHeadersPresenter的元素");
|
throw new Exception("需要Name为PART_ColumnHeadersPresenter的元素");
|
||||||
}
|
}
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
contentPresenter = FindPresenter().FirstOrDefault(a => a.Name == "contentPresenter");
|
contentPresenter = FindPresenter().FirstOrDefault(a => a.Name == "contentPresenter");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,9 +271,9 @@ namespace CPF.Controls
|
|||||||
return FindPresenter<Panel>().FirstOrDefault(a => a.Name == "itemsPanel");
|
return FindPresenter<Panel>().FirstOrDefault(a => a.Name == "itemsPanel");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
panel = GetItemsPanel();
|
panel = GetItemsPanel();
|
||||||
//if (panel == null)
|
//if (panel == null)
|
||||||
//{
|
//{
|
||||||
|
@ -179,9 +179,9 @@ namespace CPF.Controls
|
|||||||
|
|
||||||
VirtualizationPresenter<ListBoxItem> presenter;
|
VirtualizationPresenter<ListBoxItem> presenter;
|
||||||
//Panel InnerPanel;
|
//Panel InnerPanel;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
if (isVirtualizing)
|
if (isVirtualizing)
|
||||||
{
|
{
|
||||||
presenter = FindPresenter<VirtualizationPresenter<ListBoxItem>>().FirstOrDefault();
|
presenter = FindPresenter<VirtualizationPresenter<ListBoxItem>>().FirstOrDefault();
|
||||||
|
@ -322,9 +322,9 @@ namespace CPF.Controls
|
|||||||
this.Triggers.Add(new Styling.Trigger { Property = nameof(IsMouseOver), Setters = { { nameof(Background), "#fff" } } });
|
this.Triggers.Add(new Styling.Trigger { Property = nameof(IsMouseOver), Setters = { { nameof(Background), "#fff" } } });
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,10 +331,10 @@ namespace CPF.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool isFirst;
|
bool isFirst;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
isFirst = true;
|
isFirst = true;
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
isFirst = false;
|
isFirst = false;
|
||||||
if (selectIndex.HasValue)
|
if (selectIndex.HasValue)
|
||||||
{
|
{
|
||||||
|
@ -107,9 +107,9 @@ namespace CPF.Controls
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
numTextBox = FindPresenterByName<TextBox>("numTextBox");
|
numTextBox = FindPresenterByName<TextBox>("numTextBox");
|
||||||
}
|
}
|
||||||
TextBox numTextBox;
|
TextBox numTextBox;
|
||||||
|
@ -138,9 +138,9 @@ namespace CPF.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if !DesignMode //用户代码写到这里,设计器下不执行,防止设计器出错
|
#if !DesignMode //用户代码写到这里,设计器下不执行,防止设计器出错
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
|
|
||||||
}
|
}
|
||||||
//用户代码
|
//用户代码
|
||||||
|
@ -97,9 +97,9 @@ namespace CPF.Controls
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
_indicator = FindPresenter().FirstOrDefault(a => a.Name == "Indicator");
|
_indicator = FindPresenter().FirstOrDefault(a => a.Name == "Indicator");
|
||||||
_Animation = FindPresenter().FirstOrDefault(a => a.Name == "Animation");
|
_Animation = FindPresenter().FirstOrDefault(a => a.Name == "Animation");
|
||||||
}
|
}
|
||||||
|
@ -197,9 +197,9 @@ namespace CPF.Controls
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
this.Track = FindPresenter<Track>().FirstOrDefault(a => a.Name == "PART_Track");
|
this.Track = FindPresenter<Track>().FirstOrDefault(a => a.Name == "PART_Track");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ namespace CPF.Controls
|
|||||||
|
|
||||||
Panel headerPanel;
|
Panel headerPanel;
|
||||||
Panel contentPanel;
|
Panel contentPanel;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
headerPanel = FindPresenter<Panel>().FirstOrDefault(a => a.Name == "headerPanel");
|
headerPanel = FindPresenter<Panel>().FirstOrDefault(a => a.Name == "headerPanel");
|
||||||
if (!headerPanel)
|
if (!headerPanel)
|
||||||
@ -410,7 +410,7 @@ namespace CPF.Controls
|
|||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
}
|
}
|
||||||
[PropertyChanged(nameof(SelectedIndex))]
|
[PropertyChanged(nameof(SelectedIndex))]
|
||||||
void RegisterSelectedIndex(object newValue, object oldValue, PropertyMetadataAttribute attribute)
|
void RegisterSelectedIndex(object newValue, object oldValue, PropertyMetadataAttribute attribute)
|
||||||
|
@ -420,9 +420,9 @@ namespace CPF.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
ScrollViewer scrollViewer;
|
ScrollViewer scrollViewer;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
if (view == null)
|
if (view == null)
|
||||||
{
|
{
|
||||||
view = TextBoxView;
|
view = TextBoxView;
|
||||||
|
@ -1795,9 +1795,9 @@ namespace CPF.Controls
|
|||||||
|
|
||||||
//}
|
//}
|
||||||
internal List<(Delegate, UIElement)> afterStyles;
|
internal List<(Delegate, UIElement)> afterStyles;
|
||||||
protected override void OnInitializedAsync()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitializedAsync();
|
base.OnInitialized();
|
||||||
if (afterStyles != null)
|
if (afterStyles != null)
|
||||||
{
|
{
|
||||||
foreach (var item in afterStyles)
|
foreach (var item in afterStyles)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user