Designing a WPF / MVVM architecture where view behavior changes in different states

As part of my bachelors thesis, I’m trying to develop something akin to a painting program. That means, I have a toolset, be it selection, drawing, highlighting, etc.

I’ll have a canvas that displays my current model, based on a set of rectangles/spheres/polygons I have already drawn and created.

Some tools require the view to react differently based on the tools. Rough Examples:

I have a “New Line” tool. The view now displays points you can connect from when you hover over them.

I have a “Selection” tool. When I hover over an element, it’s entire color changes.

I have a “New Element” tool. When I move my mouse, a shadow of the element follows my cursor until I press the left mouse buttons.

Now, here’s where I’m a little stuck:

All these tools require wildly different behaviour from the view, and not only that, it also requires the view to be dynamic based on calculated properties. I got a few ideas how I could architect my system, but I would rather get nudged into a direction before I do a huge mistake. Here’s my questions and thoughts :

Q: First of all, where would I even put that interactive code? I can’t do it in XML, since it requires calculation, but putting it in the ViewModel is also not correct since the ViewModel is not supposed to know about the View. Thus, do I put it in the Code of the View itself? That also seems kinda strange to me.

Now to my architectural ideas:

Idea 1: I could do a new View + Viewmodel for each tool. When A new tool is selected, the view and viewmodel are simply exchanged in a frame, and all the behaviour is encapsulated inside the new view + ViewModel. However, that seems like it not only tightly couples each View and ViewModel together, it also feels like a lot of boilerplate code.

Idea 2: Each Tool itself has “Command” class based on a ICommand interface that requires a reference to the view as well as every possible option of User Interaction. Then the ViewModel delegates the UserInput onto the current Command, which can then manipulate the given ViewInstance to display things it wants. This however feels very inflexible, as if I’m just delegating the problem from Idea 1 somewhere else, and incapable of future growth. Whenever I want to add a new way for a user to interact, I’d have to go and adjust the interface, and perhaps all underlying commands if I didn’t provide a default implementation.

None of these really satisfy me, and I’m feeling like I’m missing a crucial step for this part of the architecture. I’d gladly appreciate any pointer. Thank you for your time and reading!

Custom JS produces different results based on user’s permission level in SP 2013

HELP! I understand this question is a bit vague, however, that is because I have never run into this issue before and I have no idea where to start.

Anyone who can share a similar experience and what they did to solve the problem is a Godsend

I have custom JS for an uploader that ingests excel files, parses the data and put that data into SharePoint lists. It uses the following libraries: xlsx.core.min.js, xlsx.full.min.js, and jquery.min.js.

This uploader behaves differently depending upon the permission level of the person attempting to do the upload. IE – you must have full control or be an SCA for it to work as intended. None of the scripts make a reference to other subsites, everything is local. I have never heard of this before and am having trouble finding help online for this topic.

Any takers??

Why are those very similar languages in a different complexity class?

i am having a real time understand why the following two languages are in two different complexity classes(the first is NP-Hard and the second is in P). tried to look online at various resources and lecture notes/books, but couldn’t find a reason for it. the languages are:

1.$ NONEMPTY-INTER_{DFA}\:=\:\left\{<A_1,…,A_k> |\:A_1,…,A_k\:are\:DFAS\:and\:L\left(A_1\right)\cap…\:\cap L\left(A_k\right)\:\ne \varnothing \right\}$

2.$ NONDISJOINT_{DFA}\:=\:\left\{<A,B> |\:A\:and\:B\:are\:DFAS\:and\:L\left(A\right)\:\cap L\left(b\right)\:\ne \varnothing \right\}$

why is the second can be run in a polynomial time on a turing machine, and the first can not? would really appreciate an explanation for this.

Same file server root directory for multiple domains over different network interfaces for each domain

I currently host a 16TB CentOS ESXi Virtual Machine with 1 virtual interface with a public static IP behind a Nexus 3K switch in my datacenter serving a web archive over Nginx to the public. Everything works fine and I graph the VM’s only interface via SNMP and Cacti graph tool.

I want another domain name to point to the same server and the same archive which I believe can be configured via virtual hosts in Nginx.

The problem is I need to create graphs from the machine’s network interfaces via SNMP and log traffic information “per domain name” in Cacti which makes things a little tricky so I believe the only way to graph different domains is to somehow use different IP addresses on different interfaces for each domain. Wouldn’t that create a default gateway problem? The public IP addresses can be from the same network.

I don’t necessarily need to have separate IPs since I just want graphs to be made, also sadly you can’t generate graphs for alias interfaces.

Just putting it out there can things like Docker, VRF or even NAT on the Nexus switch help me achieve this?

Spanning a finite vector space using different powers of a diagonalizable matrix.

D be an n x n real diagonal matrix. show that there exists a x $ \epsilon$ $ \Bbb R$ $ ^n$ such that

span{D$ ^k$ x: 0$ \le$ k$ \le$ (n-1)} = $ \Bbb R$ $ ^n$

if and only if the eigenvalues of D are distinct.

I can show that if D has distinct eigenvalues then $ \Bbb R$ $ ^n$ isa direct sum of n eigenspaces and I can find the required x such that the condition holds, but i am unable to prove it the other way round.

Do the “virtual memory”s mentioned in the 2 articles refer to different things?

I’ve read the following 2 articles explaining the difference between virtual memory and physical memory. One thing that I found confusing is that the term virtual memory seems to mean different things in these 2 articles.

What Is the Difference Between Virtual Memory & Physical Memory? says Virtual memory is used when the RAM is filled.

While Wikipedia says virtual memory is used to tell programs where the physical memory is.

Is one of the articles wrong? Or does virtual memory have different meaning in different context?

Shared tenant different header

AS-IS: There is a group of companies, every company (exclude one) have the same brand (same colors, names, …), but this one company (our) have different brand (e.g. wecare, with different colors, …) and the problem is that we share one tenant on o365 (we can´t make our own tenant). As we are part of the same tenant, the visual is the same for every company. For our sites we use prefix (wecare) and join sites to one hub.

TO-BE We need to change our header to be different from the other companies, and stay on that tenat.

(names of companies are fancifully) Visualization on picture example

Is there any way we do this (without some big hacking)? Maybe with some spfx webpart or extension?

Thank you for your help 🙂

Keto Buzz: Burn Your fatness from the different part of body

Keto Buzz reviews :-Weight loss was top notch in my book. Let's face it, there is a lot to learn. This is just one of the several checks and balances. It's true that not everybody has this kind of support system for weight less. The basics behind planning your weight loss Formula are just like planning your weight loss Tips. This is something that my step-mother repeats often, "One man's loss is another man's gain."

Click here…

Keto Buzz: Burn Your fatness from the different part of body

Internet access robust test to several different sites (command line)

It seems my ISP is a mess, blocking some relevant and renowned sites/IPs (maybe through DNS, I don’t really know) and not others, it’s been a nightmare.

Is there a command line script to test internet access to a wide (I know, fully is literally impossible) variety of known websites and IP addresses? A kind of AND amongst several pings to different credited websites and IPs, such that I can test the “health” of the DNS servers I’m using and the freedom of internet access I’m allowed to.

I simple do not want to do ping all the time and it’s been like lottery. It seems I can use a bash with wget --spider --quiet, but has anyone a script or bash ready to use that want to share?