Unable to load DLL 'sqlite3' at design time - windows-runtime

I get the Error Unable to load DLL 'sqlite3' while I have the XAML Designer of my WP8.1 Universal project open and a Data Context set like this:
DataContext="{Binding IntakeReasonListViewModel, Source={StaticResource Locator}}"
The Locator is designed like the recommended MVVM Light View Model Locator and uses the ServiceLocator.
The error message appears only in design time and it works withouth any problems while executing. Also I have 3 apps. 2 of them have this issue, one does not. But I can't find any difference between them regarding to the SQLite.
I found different threads with the similar message, but all these problems appeard to runtime and caused some errors on saving items, while mine problem doesn't.
EDIT: I found out that the problem is that I inject my data access via a repository class to the view model. This way the designer tries to load the data access, inclusive the sqlite modul..
Does anyone know a way to avoid this for design time?
Thanks
Regards
NPadrutt

You can always use a separate ViewModel for design time. I find it a good practice to have 3 files for each View (eg. for MainPage):
IMainPageViewModel (contains bindable properties, commands etc...)
MainPageViewModel (child of ViewModelBase, implements IMainPageViewModel)
MainPageDesignViewModel (child of ViewModelBase, implements IMainPageViewModel)
This way you can avoid loading the other services, and just display some demo data that'll help you in design mode. This answer to an other question details how to use a separate service or a separate ViewModel for design time: https://stackoverflow.com/a/14154088/4788286 (With MVVMLight the key is to use the ViewModelBase.IsInDesignMode and ViewModelBase.IsInDesignModeStatic properties.)

Related

Polymer - avoid reinventing the wheel

Sorry if this is a generic question, but I have been given a task to develop a web application, and I'd like to use this opportunity to dive into and learn about Polymer (and maybe Vaadin components?).
I'd like to avoid reinventing the wheel. But I'm a newbie regarding Polymer. So, given the following task, is there any approach and component that will make the developing quicker/smarter?
Create an application which will allow at least two users to log in simultaneously and manage items in categories. The categories should be in a hierarchy of potentially infinite depth. The items only require a label.
The users should be able to perform standard CRUD, plus if one user makes a change, the other user(s) should see the change (if appropriate) without manually refreshing their web browser.
How should I approach this with Polymer?
Has anyone done anything similar?
I'm also open to Vaadin components if it helps.
Any help or guideline?
🙏
One way would be to start from an application template like polymer3-webpack-starter or pwa-starter-kit.
If you are looking to use Vaadin components like vaadin-grid, use polymer3-webpack-starter or one of the starters from the vaadin.com/start page.
If you do not need an example specifically with Vaadin components, then pwa-starter-kit would be a good starting point. Though it assumes familiarity with redux.
Pro: You can quickly get a running application that you can modify to your needs, and you do not have to set a project from scratch (build tool chain, module bundler, tests, configuration, etc - all of that is done already).
Con: Making modifications to the project setup won't be necessarily easy because at that point you will have to dive into the project setup that somebody has done for you.

Adding MySQL to Application Insights

Application Insights does not support tracking for MySQL dependencies out of the box, so I would like to add it as my project relies heavily on MySQL.EF6.
Per the documentation here: https://azure.microsoft.com/en-us/documentation/articles/app-insights-api-custom-events-metrics/#track-dependency
It is possible to add tracking, however to avoid having to wrap every call I make to my database, I would like to override the MySQL.EF6 Library functions of SaveChanges, SaveChangesAsync, Find, FirstOrDefault, etc.
However I am unsure how to accomplish anymore than the SaveChanges/SaveChangesAsync as they are easily overrideable in my DbContext class.
You can try using EF6 logging - https://msdn.microsoft.com/en-us/data/dn469464.aspx.

View configuration and Module lazy loading in Zend Framework 2

I have designed a initial module lazy-loading system for a particular goal. In my special case there're a few modules that are needed to decorate forms and entities of the rest of the app.
However most of my members will only require a single one of them that will most likely never update. That is why I do not wish to load all of these modules in every request.
Now that worked like a charm until I required to provide extra view files from these modules. It appears like the module's
view_manager
config is not it merged into the
ViewManager
which is why the resolver is not capable to resolve the view file. I am now loading all these modules by default for testing -- it works.
My lazy loading mechanism bases on a
ModuleManager::loadModule()
call in case it is not it loaded already.
Do you know easy approach to properly inject/merge the config into the ViewManager? Also is this a general problem that possibly also affects other components? Or is it a error?
Thank you in advance!

How to add a Layout / Design Exception programmatically

I want to add an exception to the layout (as it is possible in www.url.de/admin/system_config/edit/section/design/ under the point themes). The thing is that I want to add this "add Exception" via code and not via the magento backend.
Is there an easy way to do that?
Based on the OP comment, the goal is to alter theme configuration for the configured default setting based on the module controller.
This seems like a Bad Idea™. Changing theme configuration behind the scenes is going to be (1) ineffective or (2) confusing to the person administering the site.
If the design assets are being matched above the configured default field, the design exception will not apply
If the design exception does apply, it silently alters standard Magento design configuration modeling
If possible, it would be better (in your controller class or superclass) to add a custom handle to the core/layout_update object instance and then leverage the layout update system to do this.

What is SSIS order of data transformation component method calls

I am working on a custom data transformation component. I'm using NUnit and NMock2 to test as I code. Testing and getting the custom UI and other features right is a huge pain, in part because I can't find any documentation about the order in which SSIS invokes methods on the component at design time as well as runtime.
I can correct the issues readily enough, but it's tedious and time consuming to unregister the old version, register the new version, fire up the test ssis package, try to display the UI, get an obscure error message, backtrace it, modify the component and continue.
One of the big issues involves the UI component needing access to the componentmetadata and buffermanager properties of the component at design time, and what I need to provide for to support properties that won't be initialized until after the user enters them in the UI.
I can work through it; but if someone knows of some docs or tips that would speed me up, I'd greatly appreciate it. The samples I've found havn't been much use; they seem to be directed to showing off cool stuff (Twitter, weather.com) rather than actual work.
Thanks in advance.
Here's a timeline of the run-time execution sequence: Run-time Methods of a Data Flow Component
The design-time sequence isn't laid out in MSDN that nicely because there just isn't such a sequence, but here's what I think/know:
1. ProvideComponentProperties - called ONCE EVER when the component is dropped on the design surface.
2. PerformUpgrade - called ONLY if the metadata version is different than the version attribute on the class - called on package load.
3. Validate - called FREQUENTLY... during package load, input attachment, entry into editor, etc...
4. ReinitializeMetaData - called infrequently, and only because a VS_NEEDSNEWMETADATA value is returned from Validate.
Everything other override (OnInputAttached, etc.) is fairly straightforward as to when it gets called. Here's the not-so-descriptive article: Design-time Methods of a Data Flow Component.