<div dir="ltr">Just so you are aware FePy was the name of a side project that was a set of enhancements to IronPython. If you are looking for a shorter form of IronPython, IP is generally the best way to go so there is no confusion.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 24, 2014 at 4:45 PM, John Trinder <span dir="ltr"><<a href="mailto:TrinderJohn@dsl.pipex.com" target="_blank">TrinderJohn@dsl.pipex.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
I'm new to FePy and after doing a fair bit of studying am embarking
on transcoding a C# project to FePy. I'm encountering a problem
incorporating a module that defines a subclass of Canvas and then
trying to utilize this custom canvas in the Xaml code.<br>
<br>
My skeleton files/modules and contents are as follows:<br>
<br>
<u><b>module1.py<br>
<br>
</b></u>import clr<br>
clr.AddReference('PresentationFramework')<br>
import System.Windows.Controls as swc<br>
<br>
class CustomCanvas(swc.Canvas):<br>
def __init__(self):<br>
pass<u><b><br>
<br>
</b></u><u><b>WpfApplication1.xaml</b></u><br>
<br>
<Window <br>
xmlns=<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation" target="_blank">"http://schemas.microsoft.com/winfx/2006/xaml/presentation"</a> <br>
xmlns:x=<a href="http://schemas.microsoft.com/winfx/2006/xaml" target="_blank">"http://schemas.microsoft.com/winfx/2006/xaml"</a> <br>
<b>xmlns:local="clr-namespace:module1"</b><br>
Title="WpfApplication1" Height="300" Width="300"> <br>
<Grid><br>
<b><local:CustomCanvas HorizontalAlignment="Left"
Height="100" Margin="96,90,0,0" VerticalAlignment="Top"
Width="100"/></b><br>
</Grid><br>
</Window> <br>
<br>
<u><b>WpfApplication1.py</b></u><br>
<br>
import wpf<br>
<br>
from System.Windows import Application, Window<br>
<br>
class MyWindow(Window):<br>
def __init__(self):<br>
wpf.LoadComponent(self, 'WpfApplication1.xaml')<br>
<br>
Application().Run(MyWindow())<br>
<br>
<br>
I've marked in bold where I have incorporated my module/namespace.
Intellisense says that on the <b><local:CustomCanvas .../></b>
line, CustomCanvas 'does not exist in the namespace <b>"clr-namespace:module1"'</b><br>
I'm guessing that it's not possible to do (yet) what I want to do -
which is pretty basic.<br>
Thanks in advance btw for any advice and tips.<br>
</div>
<br>_______________________________________________<br>
Ironpython-users mailing list<br>
<a href="mailto:Ironpython-users@python.org">Ironpython-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">https://mail.python.org/mailman/listinfo/ironpython-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Website: <a href="http://earl-of-code.com" target="_blank">http://earl-of-code.com</a>
</div>