-
-
Save jasondown/f095a4fa9a344cfdc89f51f4c325de73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// This class wraps a custom multi-image WPF control so that it can be exposed to NAV. | |
/// </summary> | |
[ControlAddInExport("Jason.Down.Blog.MultiImageAddinDemo.Controls.MultiImageAddinHostControl")] | |
public class MultiImageAddinHostControl : WinFormsControlAddInBase | |
{ | |
private ElementHost _host; | |
private MultiImageView _view; | |
private PageableImageControlViewModel _vm; | |
/// <summary> | |
/// Creates the Windows Forms Control for the control add-in. | |
/// </summary> | |
/// <returns>Returns the Windows Forms control.</returns> | |
protected override Control CreateControl() | |
{ | |
_vm = new PageableImageControlViewModel() | |
{ | |
PageSize = 3 | |
}; | |
_view = new MultiImageView() | |
{ | |
DataContext = _vm | |
}; | |
_host = new ElementHost() | |
{ | |
Dock = DockStyle.Top, | |
Child = _view, | |
Size = new Size((int) _view.Width, (int) _view.Height) | |
}; | |
return _host; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment