If you created an empty Web Part you need to update the code!
Check out these docs: docs.kentico.com/.../creating-new-web-parts
The code needed to retrieve from the Web Part property (or if it's a Widget from the Widget):
Since Widgets point to a Web Part they are basically the same, and the difference is mainly in how they are used in the Admin interface.
There are also a lot of out-of-the-box Widgets and Web Parts available. The code for them is available in your solution (CMSWebParts folder) so check them out if you want to understand how they work.